Skip to content
Snippets Groups Projects

add option to link sbin/kresd to jemalloc

Merged Vladimír Čunát requested to merge jemalloc into master

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

Pipeline #106929 waiting for manual action

Pipeline waiting for manual action for f7c47a2c on jemalloc

Approval is optional

Merged by Vladimír ČunátVladimír Čunát 2 years ago (Nov 30, 2022 5:11pm UTC)

Pipeline #107170 failed

Pipeline failed for 74048dc5 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Vladimír Čunát added 8 commits

    added 8 commits

    Compare with previous version

    Toggle commit list
  • 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.
  • Vladimír Čunát added 14 commits

    added 14 commits

    Compare with previous version

    Toggle commit list
  • Vladimír Čunát mentioned in commit 74048dc5

    mentioned in commit 74048dc5

Please register or sign in to reply