Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

FerroTunnel Profiler Tools

Scripts and utilities for profiling FerroTunnel performance.

Prerequisites

Install profiling tools:

# Linux (Ubuntu/Debian)
sudo apt-get install linux-tools-generic perf

# Rust profiling tools
cargo install flamegraph
cargo install cargo-flamegraph

Scripts

profile-server.sh

Profile the tunnel server under load:

./tools/profiler/profile-server.sh

Generates a flamegraph of server CPU usage.

profile-codec.sh

Profile the protocol codec (encode/decode):

./tools/profiler/profile-codec.sh

profile-memory.sh

Profile memory allocations:

./tools/profiler/profile-memory.sh

Output

All profiles are saved to ./target/profiles/:

  • *.svg - Flamegraph visualizations
  • *.data - Raw perf data
  • *.txt - Summary reports

Quick Profiling

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

Environment Variables

Variable Description Default
PROFILE_DURATION How long to profile (seconds) 30
PROFILE_OUTPUT Output directory ./target/profiles
SAMPLE_FREQUENCY perf sample frequency (Hz) 99