Overview
Yellowstone gRPC performance depends on several factors including Tokio runtime configuration, channel capacities, compression settings, and network parameters. This guide covers all available tuning options.Tokio Runtime Configuration
Worker Threads
Configure the number of Tokio worker threads based on your CPU cores and workload:Number of worker threads in the Tokio runtime. Defaults to the number of CPU cores if not specified.
- Low traffic: 2-4 threads
- Medium traffic: 4-8 threads
- High traffic: 8-16 threads
- Very high traffic: 16+ threads (ensure you have sufficient CPU cores)
CPU Affinity
Pin Tokio threads to specific CPU cores for better cache locality and performance:CPU core affinity specification. Use ranges (0-3) or individual cores (0,2,4) separated by commas.
- NUMA systems: Pin to cores on the same NUMA node as your network interface
- Hyper-threading: Use physical cores (e.g., “0-3,8-11”) or separate logical cores
- Shared systems: Reserve specific cores for the plugin
Channel Capacity Tuning
Per-Connection Channel Capacity
Capacity of the channel per gRPC connection. Increase for high-throughput clients.
- Default: 250,000 (works for most cases)
- High-frequency traders: 500,000 - 1,000,000
- Low-resource environments: 50,000 - 100,000
Snapshot Channel Capacity
For snapshot operations (initial account loading):Capacity of the channel used for accounts from snapshot. When set, blocks validator startup if limit is reached.
Capacity of the client channel for snapshot data.
Compression Settings
Configure compression algorithms for optimal bandwidth/CPU tradeoff:Compression algorithms accepted from clients.
Compression algorithms used when sending data to clients.
Compression Algorithm Comparison
| Algorithm | Compression Ratio | CPU Usage | Latency | Best For |
|---|---|---|---|---|
| None | 1.0x | Minimal | Lowest | Local networks, low CPU |
| gzip | 3-4x | Medium | Medium | Balanced performance |
| zstd | 3-5x | Low-Medium | Low | High throughput |
- Low bandwidth: Use
["zstd", "gzip"]for maximum compression - Low latency: Disable compression or use zstd only
- Balanced: Default
["gzip", "zstd"]works well
HTTP/2 Tuning
Adaptive Window
Enable HTTP/2 adaptive flow control windows:Enable adaptive HTTP/2 flow control windows for better throughput on high-latency connections.
Connection Window Sizes
Initial HTTP/2 connection window size in bytes. Increase for high-bandwidth connections.
Initial HTTP/2 stream window size in bytes.
- Default: 65,535 bytes (HTTP/2 default)
- High bandwidth: 1,048,576 bytes (1 MiB)
- Very high bandwidth: 4,194,304 bytes (4 MiB)
Keepalive Settings
Preventing connection timeouts through load balancers:Interval between HTTP/2 keepalive pings.
Timeout waiting for keepalive ping acknowledgment.
Most cloud load balancers (Cloudflare, AWS ALB, etc.) close idle connections after 30-120 seconds. Set keepalive_interval to 30-60 seconds to prevent disconnections.
Message Size Limits
Maximum size of decoded messages in bytes (4 MiB default).
- Large account data subscriptions
- Full block subscriptions with many transactions
- Historical data replay
Concurrency Limits
Unary Request Concurrency
Maximum concurrent unary RPC requests (GetLatestBlockhash, GetBlockHeight, etc.).
Subscription Limits
Maximum concurrent subscriptions per subscriber ID (based on x-subscription-id header or remote IP).
When true, reject subscriptions exceeding the limit with RESOURCE_EXHAUSTED. When false, only log and emit metrics.
Encoding Performance
Encoder Threads
Number of threads for parallel message encoding.
- Low traffic: 2 threads
- Medium traffic: 4 threads (default)
- High traffic: 8-16 threads
Filter Name Caching
Maximum size of individual filter names in bytes.
Number of cached filter names before cleanup.
Interval for filter name cache cleanup once size limit is reached.
Replay Configuration
Number of recent slots to store for replay/retransmission. Set to 0 to disable.
- Enable (100-1000 slots): When clients need to catch up on missed data
- Disable (0): For real-time only streams to save memory
Traffic Reporting
Byte threshold for updating traffic metrics in Prometheus.
Higher values = less overhead, coarser metrics