Overview
Firedancer is designed from the ground up to be fast, with a concurrency model drawn from experience in the low latency trading space. This guide covers advanced optimization techniques to maximize your validator’s performance.Architecture Optimizations
Tile Pipeline Design
Firedancer organizes work into a pipeline where transactions flow through the system in a linear sequence:Each instance of a job running on a CPU core is called a tile. Tiles communicate with each other using message queues.
Backpressure Management
If a queue between two tiles fills up, the producer will either:- Block - Wait until there is free space to continue (called backpressure)
- Drop - Discard transactions or data and continue
CPU and Memory Optimizations
Dedicated CPU Cores
Firedancer pins a dedicated thread to each CPU core on the system. Each thread does one specific kind of work, and tiles are connected together in a graph to form an efficient pipeline.Hyperthreading Considerations
Use stride in affinity strings to skip hyperthread siblings:Huge Pages
Firedancer pre-allocates all memory in two kinds of pages to prevent TLB misses:- Huge pages - 2 MiB
- Gigantic pages - 1 GiB
Memory Workspace
Firedancer creates a “workspace” file in the hugetlbfs mount. The workspace is a single mapped memory region within which the program lays out and initializes all data structures it needs in advance.Network Optimizations
XDP Configuration
Use Linux Express Data Path (XDP) for high-performance networking:- XDP Modes
- Zero-Copy Mode
- RSS Queue Mode
skb (default)
- Slowest mode but compatible with all network devices
- Well tested and stable
- Good for testing and development
- Much faster than skb mode
- Requires supported hardware (mlx5, i40e, ice drivers)
- May require recent Linux kernel versions
- Best for production deployments
- Automatically selects drv or skb based on hardware support
Socket Buffers
If using socket networking (not recommended for production), increase buffer sizes:Storage Optimizations
In-Memory Ledger
For maximum performance during benchmarking or when disk I/O is not critical:Snapshot Configuration
Optimize snapshot settings to balance between storage and recovery:Ledger Size Limits
Control disk usage by limiting ledger size:RPC Optimizations
Disable Expensive Features
For validators focused on consensus and block production:Private RPC Configuration
If you don’t want to serve public RPC requests:Tile-Specific Optimizations
Verify Tiles
Signature verification is often the bottleneck. Optimize by:- Maximize verify tile count - Use as many cores as available
- Each verify tile handles 20-40k TPS on modern hardware
- Monitor with
fdctl monitorfor saturation
Bank Tiles
Bank tiles execute transactions but have diminishing returns:- Start with 4 tiles for balanced scheduling
- Use 10-20 tiles with revenue scheduling
- Bank tiles don’t scale linearly due to lock contention
Shred Tiles
Shred performance depends on cluster size:- 1 tile is sufficient for mainnet (~5000 validators)
- 2 tiles may be needed for testnet
- Small dev clusters can handle >1M TPS with 1 tile
Consensus Optimizations
PoH Speed Test
Verify your hardware can keep up with the network:Network Speed Test
Known Validators
Only trust snapshots from known validators:Agave Process Tuning
Unified Scheduler Threads
The Agave subprocess uses threads for transaction execution:agave_cores >= 8:agave_cores - 44 <= agave_cores < 8:4agave_cores < 4:agave_cores
Core Blocklist
Prevent Firedancer from using cores needed by other processes:By default, core 0 and its hyperthread sibling are blocklisted to prevent interference with OS kernel threads.
Logging Optimizations
Log Levels
Adjust log verbosity for production:Log Rotation
Firedancer doesn’t support SIGUSR1/SIGUSR2 for log rotation. Uselogrotate with copytruncate:
Monitoring and Profiling
Prometheus Metrics
Firedancer exposes Prometheus-compatible metrics:Live Monitoring
Usefdctl monitor to watch tile performance in real-time:
GUI
Enable the web GUI for visual monitoring:Production Best Practices
- Mainnet Configuration
- RPC Node Configuration
- Development Configuration
Performance Checklist
- Use auto or manual affinity with no overlap between Firedancer and Agave cores
- Enable XDP with driver mode (
xdp_mode = "drv") - Enable XDP zero-copy mode if supported
- Use gigantic (1 GiB) pages for memory allocation
- Increase verify tile count until no longer bottleneck
- Set bank tile count appropriately (4 for balanced, 10-20 for revenue scheduling)
- Disable unnecessary RPC features (transaction_history, extended_tx_metadata_storage)
- Use in-memory ledger for benchmarking or fast NVMe for production
- Enable PoH and network speed tests
- Monitor with
fdctl monitorand Prometheus metrics - Configure log rotation with
copytruncate
Troubleshooting Performance Issues
Low Transaction Throughput
- Check verify tiles with
fdctl monitor - Increase
verify_tile_countif tiles are saturated - Verify no CPU core overlap between Firedancer and Agave
- Check network device supports XDP driver mode
High CPU Context Switches
- Verify tiles have dedicated CPU cores
- Check for affinity overlap
- Use the
diagtile to monitor context switches - Consider disabling hyperthreading in BIOS
Memory Allocation Failures
- Verify huge/gigantic pages are configured:
cat /proc/meminfo | grep Huge - Check hugetlbfs mount:
mount | grep hugetlbfs - Increase system huge page allocation in
/etc/sysctl.conf
Network Packet Loss
- Switch to XDP driver mode from skb mode
- Increase XDP queue sizes
- Enable zero-copy mode
- Check for network device driver updates