Skip to content

Performance_optimization

Optimizing blockchain node performance is critical for achieving better throughput, lower latency, and reduced resource usage. This chapter covers comprehensive techniques to maximize your node’s efficiency.


┌─────────────────────────────────────────────────────────────────────────────┐
│ RECOMMENDED HARDWARE FOR BLOCKCHAIN NODES │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ENTRY-LEVEL NODE PRODUCTION NODE │
│ ━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━ │
│ CPU: 4 cores CPU: 8+ cores │
│ RAM: 8 GB DDR4 RAM: 32 GB DDR4 │
│ Storage: 512 GB NVMe Storage: 2 TB NVMe │
│ Network: 100 Mbps Network: 1 Gbps │
│ │
│ ARCHIVE NODE VALIDATOR NODE │
│ ━━━━━━━━━━━━ ━━━━━━━━━━━━━━ │
│ CPU: 8+ cores CPU: 4 cores │
│ RAM: 32 GB DDR4 RAM: 16 GB DDR4 │
│ Storage: 8+ TB NVMe Storage: 512 GB NVMe │
│ Network: 1 Gbps Network: 1 Gbps │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
Storage TypeRead SpeedWrite SpeedIOPSRecommended For
NVMe SSD3,500 MB/s3,000 MB/s500K+All nodes
SATA SSD550 MB/s520 MB/s90KLight nodes
HDD120 MB/s100 MB/s200Not recommended
┌─────────────────────────────────────────────────────────────────┐
│ RAM AND CPU OPTIMIZATION │
├─────────────────────────────────────────────────────────────────┤
│ │
│ RAM USAGE PATTERNS: │
│ ━━━━━━━━━━━━━━━━━━━━━ │
│ │
│ ┌──────────────────┐ ┌──────────────────┐ │
│ │ Geth/Erigon │ │ Cosmos │ │
│ │ ━━━━━━━━━━━━ │ │ ━━━━━━━━━━━ │ │
│ │ │ │ │ │
│ │ State Cache: │ │ State Cache: │ │
│ │ 4-8 GB │ │ 2-4 GB │ │
│ │ │ │ │ │
│ │ mempool: 1-2 GB │ │ mempool: 1 GB │ │
│ │ │ │ │ │
│ │ overhead: 2 GB │ │ overhead: 2 GB │ │
│ └──────────────────┘ └──────────────────┘ │
│ │
│ CPU OPTIMIZATION: │
│ ━━━━━━━━━━━━━━━━━ │
│ │
│ - Enable turbo boost for single-thread performance │
│ - Use CPUs with high clock speed (3.5+ GHz) │
│ - Disable hyper-threading for consistent performance │
│ - Pin node process to specific cores │
│ │
└─────────────────────────────────────────────────────────────────┘

Terminal window
# Optimized Geth startup flags
geth \
--mainnet \
--syncmode "snap" \
--cache 8192 \
--cache.database 4096 \
--cache.gc 1024 \
--txpool.pricebump 1 \
--txpool.nolocals \
--txpool.accountslots 16 \
--txpool.globalslots 4096 \
--http \
--http.addr "0.0.0.0" \
--http.port 8545 \
--http.api "eth,net,web3,debug,txpool" \
--http.vhosts "*" \
--http.corsdomain "*" \
--ws \
--ws.addr "0.0.0.0" \
--ws.port 8546 \
--ws.api "eth,net,web3,debug,txpool" \
--ws.origins "*" \
--datadir /data/ethereum \
--keystore /data/ethereum/keystore \
--networkid 1 \
--port 30303 \
--maxpeers 50 \
--nat "extip:YOUR_IP" \
--pprof \
--pprof.addr "127.0.0.1" \
--pprof.port 6060 \
--metrics \
--metrics.addr "127.0.0.1" \
--metrics.port 6061
Terminal window
# Erigon optimized configuration
erigon \
--chain mainnet \
--datadir /data/erigon \
--http \
--http.addr "0.0.0.0" \
--http.port 8545 \
--http.api "eth,net,web3,debug,txpool,erigon,debug" \
--ws \
--ws.addr "0.0.0.0" \
--ws.port 8546 \
--ws.api "eth,net,web3" \
--http.vhosts "*" \
--http.corsdomain "*" \
--metrics \
--metrics.addr "127.0.0.1" \
--metrics.port 6060 \
--pprof \
--pprof.addr "127.0.0.1" \
--pprof.port 6061 \
--torrent.download.rate 50mb \
--db.size.limit 3tb \
--maxpeers 100 \
--rpc.batch.concurrency 100 \
--rpc.allow-unprotected-txs \
--txpool.locals 0xYourAddress
Terminal window
# Using PebbleDB (faster than LevelDB)
--database.engine pebbledb
# LevelDB configuration
--database.leveldb.compression snappy
--database.leveldb.cache 4096
ParameterDefaultRecommendedDescription
--cache1288192Memory allocated for caching
--cache.database1284096Database cache size
--cache.gc1281024Garbage collection cache

Terminal window
# Increase peer connections
--maxpeers 100
# Bootnode configuration
--bootnodes "enode://...@ip:port,enode://...@ip:port"
# Static peers
--staticnodes "enode://..."
# NAT traversal
--nat "extip:203.0.113.1"
# P2P network tuning
--p2p.dialtimeout 10s
--p2p.readlimit 32MB
--p2p.writelimit 32MB
┌─────────────────────────────────────────────────────────────────┐
│ BANDWIDTH OPTIMIZATION │
├─────────────────────────────────────────────────────────────────┤
│ │
│ UPLOAD BOTTLENECK SOLUTIONS: │
│ ━━━━━━━━━━━━━━━━━━━━━━━━━━━ │
│ │
│ 1. Enable compression │
│ - P2P compression reduces bandwidth by 40-60% │
│ - Most clients have this enabled by default │
│ │
│ 2. Peer selection optimization │
│ - Prefer peers with good latency (<100ms) │
│ - Balance inbound/outbound connections │
│ │
│ 3. Bandwidth limits │
│ - Set reasonable limits to prevent saturation │
│ - --p2p.bandwidth.upload: 10MB/s │
│ - --p2p.bandwidth.download: 25MB/s │
│ │
│ RECOMMENDED NETWORK: │
│ ━────────────────━━━━━━ │
│ - Minimum: 100 Mbps symmetric │
│ - Recommended: 1 Gbps symmetric │
│ - For archive nodes: 1 Gbps+ │
│ │
└─────────────────────────────────────────────────────────────────┘

Terminal window
# Increase file descriptors
echo "* soft nofile 65536" >> /etc/security/limits.conf
echo "* hard nofile 65536" >> /etc/security/limits.conf
echo "root soft nofile 65536" >> /etc/security/limits.conf
echo "root hard nofile 65536" >> /etc/security/limits.conf
# Network optimization
echo "net.core.rmem_max=16777216" >> /etc/sysctl.conf
echo "net.core.wmem_max=16777216" >> /etc/sysctl.conf
echo "net.ipv4.tcp_rmem=4096 87380 16777216" >> /etc/sysctl.conf
echo "net.ipv4.tcp_wmem=4096 65536 16777216" >> /etc/sysctl.conf
echo "net.core.netdev_max_backlog=50000" >> /etc/sysctl.conf
# Apply changes
sysctl -p
# Disable transparent huge pages (can cause performance issues)
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag
Terminal window
# Set CPU affinity for geth process
sudo apt install util-linux
sudo setcap cap_sys_nice+ep /usr/bin/geth
# Run with specific cores
geth --cpus 4 ...

MetricTargetDescription
CPU Usage< 70%Average CPU usage
Memory Usage< 80%RAM usage
Disk I/O< 80%Disk throughput
Disk IOPS< 70%Input/output operations
Network InMonitorInbound bandwidth
Network OutMonitorOutbound bandwidth
Block Import Time< 500msTime to import block
Mempool SizeMonitorPending transactions
prometheus.yml
scrape_configs:
- job_name: 'ethereum-node'
static_configs:
- targets: ['localhost:6060']
metrics_path: /debug/metrics/prometheus

Terminal window
# Geth benchmark
geth snapshot bench --TrieCache 100000 --TrieBranchBuffer 16 --TrieNodeCache 100000
# Erigon benchmark
erigon bench blocks --block 15000000
# Custom benchmark script
#!/bin/bash
# benchmark.sh
echo "Starting benchmark..."
# Record initial metrics
START_TIME=$(date +%s)
START_CPU=$(top -bn1 | grep "Cpu(s)" | awk '{print $2}')
# Run load test
for i in {1..100}; do
curl -s -X POST http://localhost:8545 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
> /dev/null
done
# Record final metrics
END_TIME=$(date +%s)
END_CPU=$(top -bn1 | grep "Cpu(s)" | awk '{print $2}')
echo "Requests completed in $((END_TIME - START_TIME)) seconds"
echo "Average CPU: $(( (START_CPU + END_CPU) / 2 ))%"

QuestionAnswer
What hardware is recommended for an Ethereum node?NVMe SSD, 8+ GB RAM, multi-core CPU
What is the difference between snap and full sync?Snap sync downloads only latest state, full syncs entire blockchain
How do you optimize database performance?Use NVMe, enable compression, tune cache settings
What is the optimal cache size for Geth?4-8 GB for production nodes
How do you reduce P2P bandwidth usage?Enable compression, limit peers, use quality peers

  • Hardware: Use NVMe SSD and adequate RAM
  • Software: Configure cache, database engine, and P2P settings
  • Network: Optimize peer selection and bandwidth
  • OS: Tune kernel parameters and file descriptors
  • Monitor: Track CPU, memory, disk, and network metrics

In Chapter 50: Solana Node Setup, we’ll explore other blockchain nodes.


Last Updated: 2026-02-20