Rate_limiting
Chapter 22: Rate Limiting & Load Balancing
Section titled “Chapter 22: Rate Limiting & Load Balancing”Overview
Section titled “Overview”Rate limiting protects your RPC nodes from abuse and ensures fair resource allocation.
22.1 Why Rate Limit?
Section titled “22.1 Why Rate Limit?”- Prevent DDoS attacks
- Protect node resources
- Ensure fair access
- Manage costs
22.2 Geth Rate Limiting
Section titled “22.2 Geth Rate Limiting”# Enable rate limitinggeth \ --http.ratelimit 1000 \ --http.ratelimitburst 2000 \ --ws.ratelimit 500 \ --ws.ratelimitburst 100022.3 Nginx Rate Limiting
Section titled “22.3 Nginx Rate Limiting”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; } }}22.4 Load Balancing
Section titled “22.4 Load Balancing”HAProxy Configuration
Section titled “HAProxy Configuration”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 3Summary
Section titled “Summary”- Rate limit at application level (Geth)
- Use Nginx for additional protection
- Load balance across multiple nodes
Last Updated: 2026-02-20