Scripts and utilities for profiling FerroTunnel performance.
Install profiling tools:
# Linux (Ubuntu/Debian)
sudo apt-get install linux-tools-generic perf
# Rust profiling tools
cargo install flamegraph
cargo install cargo-flamegraphProfile the tunnel server under load:
./tools/profiler/profile-server.shGenerates a flamegraph of server CPU usage.
Profile the protocol codec (encode/decode):
./tools/profiler/profile-codec.shProfile memory allocations:
./tools/profiler/profile-memory.shAll profiles are saved to ./target/profiles/:
*.svg- Flamegraph visualizations*.data- Raw perf data*.txt- Summary reports
For quick CPU profiling without scripts:
# Build with debug symbols
cargo build --release --workspace
# Run with flamegraph (server)
cargo flamegraph --bin ferrotunnel -- server --bind 0.0.0.0:7835
# Or use perf directly
perf record -g target/release/ferrotunnel server --bind 0.0.0.0:7835
perf report| Variable | Description | Default |
|---|---|---|
PROFILE_DURATION |
How long to profile (seconds) | 30 |
PROFILE_OUTPUT |
Output directory | ./target/profiles |
SAMPLE_FREQUENCY |
perf sample frequency (Hz) | 99 |