apache / horaedb

Apache HoraeDB (incubating) is a high-performance, distributed, cloud native time-series database.
https://horaedb.apache.org
Apache License 2.0
2.64k stars 207 forks source link

Add integration with rust-jemalloc-pprof for easy mem perf #1577

Open jiacai2050 opened 4 weeks ago

jiacai2050 commented 4 weeks ago

Describe This Problem

rust-jemalloc-pprof is a cool project to do memory perf.

Proposal

Add a new HTTP endpoint /debug/pprof/heap to serve the profiling.

Additional Context

We can remove old /debug/profile/heap/{seconds} endpoint when this is ready. https://github.com/apache/horaedb/blob/79627995477acdaeaf43bcd128fdc902f5fbeaad/src/server/src/http.rs#L607

jiacai2050 commented 1 week ago

@zuston Thanks, assigned.

zuston commented 5 days ago

@zuston Thanks, assigned.

From this crate doc, I found this way is not better than the vaillina jeprof way. It just generates the pprof format, if you want to dig it with human format, you have to execute in the host machine instead of any remote machine to call api directly. Because it still depends on the execute binary.

zuston commented 2 days ago

PTAL @jiacai2050

jiacai2050 commented 2 days ago

you have to execute in the host machine instead of any remote machine to call api directly.

What do you mean by call api directly?

With pprof, we can explore the perf data in various format, such as flamegraph