Load Balancer Patterns
Production-tested strategies for distributing traffic across Nimbus backend nodes with zero-downtime failover.
Round‑Robin
Each request cycles to the next healthy backend in sequence. Simplest to implement, works well when all nodes have identical capacity and request cost is uniform.
server backend1:9000;
server backend2:9000;
server backend3:9000;
}
Least Connections
Routes to the node with the fewest active connections. Ideal when request durations vary significantly or when backend capacity is heterogeneous.
least_conn;
server backend1:9000 weight=3;
server backend2:9000 weight=1;
}
IP Hash
Hashes the client IP to pin sessions to a specific backend. Useful for stateful workloads where sticky sessions avoid cache invalidation storms.
ip_hash;
server backend1:9000;
server backend2:9000;
}
Health Checks
Active probes detect dead backends before they receive traffic. Combine with passive checks (observing 5xx responses) for defense in depth.
Circuit Breaker
When a backend exceeds a failure threshold, the circuit opens and traffic is diverted. After a cooldown, a trickle of requests probes for recovery before fully closing the circuit.
Pro tip: Layer IP hash with least connections for hybrid sticky‑aware balancing. Always deploy health checks before going to production.