ztunnel
ztunnel copied to clipboard
Enhance ztunnel heap instrumentation
Right now ztunnel exposes gperftools endpoints for both profiles and heaps, as well as a standard pprof profile.
ATM the gperftools endpoints don't work very well, or at all.
We should probably consolidate on 1 profiler and one heap dumper, and make sure they both work - whether that's gperftools or something else (jemalloc was mentioned).
Whatever we DO pick needs to work equally well on arm64 and amd64, and needs to support remote analysis, ideally.
- [x] Fix or replace gperftools to enable heap dumps: https://github.com/istio/ztunnel/pull/865
- [ ] Investigate building with/enabling
jemallocby default, at least for non-release builds, possibly for release builds if it is not a perf hit (e.g. at one time Facebook leftjemallocon permanently in prod due to nonexistent perf hit: https://www.magiroux.com/rust-jemalloc-profiling/)
https://github.com/polarsignals/rust-jemalloc-pprof or https://github.com/mkmik/heappy/ seem viable.
Prototype with heappy: https://github.com/howardjohn/ztunnel/pull/new/exp/heappy
Yep, using https://github.com/polarsignals/rust-jemalloc-pprof, seems to work well enough.
should https://github.com/istio/ztunnel/pull/865 close this one out?
@ilrudie In https://github.com/istio/ztunnel/pull/865 we discussed using jemalloc as an always-on thing, or at least enabled by default for non-release builds.
I added that as another ticket item here, so we can keep this open for that.
seems the second task has be completed, maybe we can close it.