Skip to main content

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:
Some of these jobs can be parallelized and run on multiple CPU cores at once:
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
A slow tile can cause backpressure through the rest of the system causing it to halt. The goal of adding more tiles is to increase throughput of a job, preventing dropped transactions. Example: If the QUIC server produces 100,000 transactions per second, but each verify tile can only handle 20,000 TPS, you would need five verify tiles to keep up without dropping transactions.

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.
Each tile needs a dedicated CPU core and it will be saturated at 100% utilization. Never overlap Firedancer tile cores with Agave process cores.

Hyperthreading Considerations

Use stride in affinity strings to skip hyperthread siblings:
This configuration uses physical cores 0, 2, 4, 6, etc., avoiding hyperthread contention.

Huge Pages

Firedancer pre-allocates all memory in two kinds of pages to prevent TLB misses:
  • Huge pages - 2 MiB
  • Gigantic pages - 1 GiB
Larger page sizes yield better performance by reducing TLB misses. Use “gigantic” (1 GiB) pages when possible. You may need “huge” (2 MiB) on virtualized environments like cloud providers.

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:
skb (default)
  • Slowest mode but compatible with all network devices
  • Well tested and stable
  • Good for testing and development
drv (recommended)
  • Much faster than skb mode
  • Requires supported hardware (mlx5, i40e, ice drivers)
  • May require recent Linux kernel versions
  • Best for production deployments
default
  • 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:
Using /dev/shm stores the ledger in RAM. This is faster but data will be lost on reboot. Only use for testing or when you have reliable snapshot sources.

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 monitor for 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:
This runs simulations at startup to ensure your validator can generate proof of history fast enough.

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:
Default calculation:
  • agave_cores >= 8: agave_cores - 4
  • 4 <= agave_cores < 8: 4
  • agave_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. Use logrotate with copytruncate:

Monitoring and Profiling

Prometheus Metrics

Firedancer exposes Prometheus-compatible metrics:
Query metrics:

Live Monitoring

Use fdctl monitor to watch tile performance in real-time:

GUI

Enable the web GUI for visual monitoring:

Production Best Practices

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 monitor and Prometheus metrics
  • Configure log rotation with copytruncate

Troubleshooting Performance Issues

Low Transaction Throughput

  1. Check verify tiles with fdctl monitor
  2. Increase verify_tile_count if tiles are saturated
  3. Verify no CPU core overlap between Firedancer and Agave
  4. Check network device supports XDP driver mode

High CPU Context Switches

  1. Verify tiles have dedicated CPU cores
  2. Check for affinity overlap
  3. Use the diag tile to monitor context switches
  4. Consider disabling hyperthreading in BIOS

Memory Allocation Failures

  1. Verify huge/gigantic pages are configured: cat /proc/meminfo | grep Huge
  2. Check hugetlbfs mount: mount | grep hugetlbfs
  3. Increase system huge page allocation in /etc/sysctl.conf

Network Packet Loss

  1. Switch to XDP driver mode from skb mode
  2. Increase XDP queue sizes
  3. Enable zero-copy mode
  4. Check for network device driver updates

Additional Resources