]> git.ipfire.org Git - thirdparty/public-inbox.git/commit
doc: strongly recommend MALLOC_MMAP_THRESHOLD_=131072 for glibc
authorEric Wong <e@80x24.org>
Thu, 18 Apr 2024 19:46:16 +0000 (19:46 +0000)
committerEric Wong <e@80x24.org>
Mon, 22 Apr 2024 09:55:00 +0000 (09:55 +0000)
commit488958385c6b8974b8780fb44b91c481e57c2eea
tree943ccd1de464ccbbc731afa07481060978edc9b8
parentd80ce538c826446941576eda5f7363734f94de1f
doc: strongly recommend MALLOC_MMAP_THRESHOLD_=131072 for glibc

The 131072 byte lower bound was the old default before the
sliding mmap window was introduced in modern glibc malloc.
While the sliding mmap window was intended to be faster by
reducing syscalls, zeroing and kernel overhead, it is also prone
to fragmentation from allocation patterns seen in evented Perl
servers.

Individual allocations over 128K are rare in our codebase since
there aren't many messages this large, making any performance
impact tiny.  Furthermore, the reduction in fragmentation and
memory use will be a speedup for memory-constrained systems
since they can avoid swap and have more leftover for the page
cache.
Documentation/RelNotes/v2.0.0.wip
Documentation/public-inbox-tuning.pod
examples/public-inbox-httpd@.service
examples/public-inbox-imapd@.service
examples/public-inbox-netd@.service
examples/public-inbox-nntpd@.service