Add opt.lg_extent_max_active_fit
When allocating from dirty extents (which we always prefer if available), large active extents can get split even if the new allocation is much smaller, in which case the introduced fragmentation causes high long term damage. This new option controls the threshold to reuse and split an existing active extent. We avoid using a large extent for much smaller sizes, in order to reduce fragmentation. In some workload, adding the threshold improves virtual memory usage by >10x.
This commit is contained in:
@@ -1069,6 +1069,22 @@ mallctl("arena." STRINGIFY(MALLCTL_ARENAS_ALL) ".decay",
|
||||
for related dynamic control options.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="opt.lg_extent_max_active_fit">
|
||||
<term>
|
||||
<mallctl>opt.lg_extent_max_active_fit</mallctl>
|
||||
(<type>size_t</type>)
|
||||
<literal>r-</literal>
|
||||
</term>
|
||||
<listitem><para>When reusing dirty extents, this determines the (log
|
||||
base 2 of the) maximum ratio between the size of the active extent
|
||||
selected (to split off from) and the size of the requested allocation.
|
||||
This prevents the splitting of large active extents for smaller
|
||||
allocations, which can reduce fragmentation over the long run
|
||||
(especially for non-active extents). Lower value may reduce
|
||||
fragmentation, at the cost of extra active extents. The default value
|
||||
is 6, which gives a maximum ratio of 64 (2^6).</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="opt.stats_print">
|
||||
<term>
|
||||
<mallctl>opt.stats_print</mallctl>
|
||||
|
Reference in New Issue
Block a user