From 488958385c6b8974b8780fb44b91c481e57c2eea Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 18 Apr 2024 19:46:16 +0000 Subject: 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. --- examples/public-inbox-nntpd@.service | 2 ++ 1 file changed, 2 insertions(+) (limited to 'examples/public-inbox-nntpd@.service') diff --git a/examples/public-inbox-nntpd@.service b/examples/public-inbox-nntpd@.service index 24f9ca73..556cb76f 100644 --- a/examples/public-inbox-nntpd@.service +++ b/examples/public-inbox-nntpd@.service @@ -16,6 +16,8 @@ After = public-inbox-nntpd.socket [Service] Environment = PI_CONFIG=/home/pi/.public-inbox/config \ PATH=/usr/local/bin:/usr/bin:/bin \ +TZ=UTC \ +MALLOC_MMAP_THRESHOLD_=131072 \ PERL_INLINE_DIRECTORY=/tmp/.pub-inline LimitNOFILE = 30000 -- cgit v1.2.3-24-ge0c7