Skip to content

Rate_limiting

Chapter 22: Rate Limiting & Load Balancing

Section titled “Chapter 22: Rate Limiting & Load Balancing”

Rate limiting protects your RPC nodes from abuse and ensures fair resource allocation.


  • Prevent DDoS attacks
  • Protect node resources
  • Ensure fair access
  • Manage costs

Terminal window
# Enable rate limiting
geth \
--http.ratelimit 1000 \
--http.ratelimitburst 2000 \
--ws.ratelimit 500 \
--ws.ratelimitburst 1000

http {
# Define rate limit zone
limit_req_zone $binary_remote_addr zone=api_limit:10m rate=100r/s;
limit_req_zone $binary_remote_addr zone=write_limit:10m rate=10r/s;
server {
location / {
# Apply rate limit
limit_req zone=api_limit burst=200 nodelay;
}
location /eth_sendTransaction {
limit_req zone=write_limit burst=50 nodelay;
}
}
}

frontend eth_rpc_https
bind :443 ssl crt /etc/ssl/certs/server.pem
default_backend geth_nodes
backend geth_nodes
balance roundrobin
option httpchk GET /health
server geth1 10.0.0.1:8545 check inter 5s rise 2 fall 3
server geth2 10.0.0.2:8545 check inter 5s rise 2 fall 3
server geth3 10.0.0.3:8545 check inter 5s rise 2 fall 3

  • Rate limit at application level (Geth)
  • Use Nginx for additional protection
  • Load balance across multiple nodes

Last Updated: 2026-02-20