]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
doc: limit jemalloc recommendation to 64-bit systems
authorEric Wong <e@80x24.org>
Tue, 14 May 2024 06:38:06 +0000 (06:38 +0000)
committerEric Wong <e@80x24.org>
Tue, 14 May 2024 22:08:14 +0000 (22:08 +0000)
My 32-bit server seems less happy with jemalloc; likely since
munmap is creating holes and it's not using sbrk by default.
jemalloc seems to need large VM space (not actual memory)
to work well, and that isn't a possibility for constrained
32-bit systems.

Documentation/RelNotes/v2.0.0.wip
Documentation/public-inbox-tuning.pod
examples/public-inbox-netd@.service

index 794d79565abbdd0e69590414bdc070a244908440..f04d814411121155f86e882ade9125e4bd4d8423 100644 (file)
@@ -56,7 +56,7 @@ treewide
 
   * for daemons serving public traffic, MALLOC_MMAP_THRESHOLD_=131072 is
     recommended to reduce fragmentation in glibc malloc, while jemalloc
-    (tested as an LD_PRELOAD) is another option.
+    (tested as an LD_PRELOAD) is another option (at least for 64-bit).
 
 PublicInbox::WWW
 
index 892ee0f22d458ce3de086cdaccba3911ee5d8f57..b56c2b100a4b37465f58329c4317e1b17a26b449 100644 (file)
@@ -166,9 +166,10 @@ capacity planning.
 Bursts of small object allocations late in process life contribute to
 fragmentation of the heap due to arenas (slabs) used internally by Perl.
 glibc malloc users should use C<MALLOC_MMAP_THRESHOLD_=131072> to reduce
-fragmentation from the sliding mmap window.  jemalloc (tested as an
-LD_PRELOAD on GNU/Linux) also reduces fragmentation compared to an
-unconfigured glibc malloc in long-lived processes.
+fragmentation from the sliding mmap window.  On 64-bit systems, jemalloc
+(tested as an LD_PRELOAD on GNU/Linux) reduces fragmentation at the
+expense of VM space.  32-bit systems may be better off sticking with
+glibc and MALLOC_MMAP_THRESHOLD_.
 
 =head2 Other OS tuning knobs
 
index 51f58fbb21aa87366beca7158630389dbe2818db..2e8797ed869073a6dc973ebb795d5dd37a14e600 100644 (file)
@@ -14,9 +14,11 @@ After = public-inbox-netd.socket
 [Service]
 
 # Setting MALLOC_MMAP_THRESHOLD_=131072 reduces fragmentation by
-# disabling the sliding mmap window in glibc malloc.  An LD_PRELOAD for
-# libjemalloc may be added here, instead.  jemalloc is more resistant to
-# fragmentation in long-lived daemons than unconfigured glibc malloc.
+# disabling the sliding mmap window in glibc malloc.  For 64-bit systems,
+# LD_PRELOAD for libjemalloc may be added here, instead.  jemalloc is more
+# resistant to fragmentation in long-lived daemons than unconfigured glibc
+# malloc on systems with large VM space.  32-bit systems may be better
+# off sticking with glibc and MALLOC_MMAP_THRESHOLD_.
 Environment = PI_CONFIG=/home/pi/.public-inbox/config \
 PATH=/usr/local/bin:/usr/bin:/bin \
 TZ=UTC \