- Port-forward admin port (15000):
kubectl port-forward -n istio-system ztunnel-qkvdj 15000:15000- Either open
localhost:15000in a browser for help, or justcurlthe CPU profile:
curl localhost:15000/debug/pprof/profile > profile.prof- Observe in your tooling of choice, such as flamegraph
-
Build
ztunnelwith thejemallocfeature (disabled by default, seeCargo.toml) -
Port-forward admin port (15000):
kubectl port-forward -n istio-system ztunnel-qkvdj 15000:15000- Either open
localhost:15000in a browser for help, or justcurlthe memory profile:
curl localhost:15000/debug/pprof/heap > mem.pb.gz- Copy container binaries to local path for symbol resolution:
# ztunnel main binary
kubectl cp istio-system/ztunnel-qkvdj:/usr/local/bin/ztunnel ../../ztunnel-libs-pprof/ztunnel
# stdlibs (optional)
kubectl cp istio-system/ztunnel-qkvdj:/usr/lib/$BINARY_COMPILED_ARCH/ ../../ztunnel-libs-pprof/- Observe in your tooling of choice, such as golang's
pprof:
PPROF_BINARY_PATH=../../ztunnel-libs-pprof pprof -http=:8080 mem.pb.gz