unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] doc: limit jemalloc recommendation to 64-bit systems
@ 2024-05-14  6:38 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2024-05-14  6:38 UTC (permalink / raw)
  To: meta

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     | 2 +-
 Documentation/public-inbox-tuning.pod | 7 ++++---
 examples/public-inbox-netd@.service   | 8 +++++---
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/Documentation/RelNotes/v2.0.0.wip b/Documentation/RelNotes/v2.0.0.wip
index 794d7956..f04d8144 100644
--- a/Documentation/RelNotes/v2.0.0.wip
+++ b/Documentation/RelNotes/v2.0.0.wip
@@ -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
 
diff --git a/Documentation/public-inbox-tuning.pod b/Documentation/public-inbox-tuning.pod
index 892ee0f2..b56c2b10 100644
--- a/Documentation/public-inbox-tuning.pod
+++ b/Documentation/public-inbox-tuning.pod
@@ -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
 
diff --git a/examples/public-inbox-netd@.service b/examples/public-inbox-netd@.service
index 51f58fbb..2e8797ed 100644
--- a/examples/public-inbox-netd@.service
+++ b/examples/public-inbox-netd@.service
@@ -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 \

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-05-14  6:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-14  6:38 [PATCH] doc: limit jemalloc recommendation to 64-bit systems Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).