Profiling
Build the server with memory profiling enabled:
cargo build --release -p riffle-server --features memory-prof
With the HTTP service configured and reachable, use the debug endpoints:
http://<server>:<http-port>/debug/heap/profile
http://<server>:<http-port>/debug/pprof/profile
The heap endpoint produces heap profiling data; the pprof endpoint captures a CPU profile for the configured sampling window.
Safe capture workflow
- Identify one affected server from metrics before profiling.
- Record the server version, workload window, and active configuration.
- Capture a short baseline outside the incident window.
- Capture the same duration during the problem.
- Compare profiles together with request rate, memory pressure, and storage latency.
Profiling consumes CPU, memory, and I/O. Start with a short capture on one server and observe its impact before collecting from additional processes.