add option to link sbin/kresd to jemalloc
And by default do so iff jemalloc is found.
I chose the simplicity of adding the chosen allocator just in the single binary. Other sbin/* don't matter really, and dynamic libs (e.g. modules) will just follow whoever loaded them.
Merge request reports
Activity
added performance label
added 8 commits
-
752a1f82...bad88c16 - 4 commits from branch
master
- b6ad9e23 - add option to link sbin/kresd to jemalloc
- 844488bf - distro/pkg/*: build with jemalloc
- 016f491b - use jemalloc in CI
- 0cf3dac7 - NEWS, doc: document jemalloc
Toggle commit list-
752a1f82...bad88c16 - 4 commits from branch
Testing
TL;DR: I re-tested memory consumption of kresd 5.5.3 with four different allocators: glibc, jemalloc, tcmalloc, musl libc. There glibc and tcmalloc turned out surprisingly bad.
One issue is that in periods with less traffic they don't return memory to OS and remain close the maximum. But even the maximums get way worse over time (compared to jemalloc and musl libc). The effect is mainly visible when the query traffic repeatedly spikes close to amount that kresd can handle (or over it).
It was fairly easy to make glibc and tcmalloc peak 100 MB higher in memory usage than jemalloc and musl with the same traffic. That was within several minutes, for a single kresd process, and it seemed like further traffic spikes could keep pushing the memory peaks higher. With jemalloc and musl the peaks seemed similar every time.
Common testing setup:
- Default settings (e.g. no forwarding), querying over UDP.
- No real memory leaks happened, so differences are due to overheads of the allocators, probably mainly due to internal fragmentation.
- Queries from https://github.com/DNS-OARC/sample-query-data
- Just simple
resperf
as generator of client traffic. - All variants running in parallel, for easier comparison of behavior.
added 14 commits
-
0cf3dac7...4a44fe52 - 10 commits from branch
master
- 4da7df65 - add option to link sbin/kresd to jemalloc
- d409727e - distro/pkg/*: build with jemalloc
- 5a02d581 - use jemalloc in CI
- f7c47a2c - NEWS, doc: document jemalloc
Toggle commit list-
0cf3dac7...4a44fe52 - 10 commits from branch
mentioned in commit 74048dc5