Tune jemalloc for SaaS
There have been several issues in the past attempting to tune jemalloc, but they did not result in any tangible outcome. The last attempt we made was #289838 (closed), but we ended up focusing on Ruby GC tuning and apart from experimenting with muzzy decay in jemalloc (with mixed success) we eventually moved on.
Now that we have detailed jemalloc stats from production nodes, and are furthermore looking to collect these regularly and automatically, we actually have data to look at and run experiments again.
References:
- https://jemalloc.net/jemalloc.3.html
- https://github.com/jemalloc/jemalloc/blob/dev/TUNING.md
- https://www.facebook.com/Engineering/videos/scalable-memory-allocation-using-jemalloc-tech-talk-1112011/696488619305/
- https://engineering.fb.com/2011/01/03/core-data/scalable-memory-allocation-using-jemalloc/
Sample data:
Tooling:
-
jemalloc.jq - Usage:
cat stats.json | jq -r -f jemalloc.jq
Edited by Matthias Käppler