retrystorm · Learn · Interview practice · Glossary · Components

Home › Reference › Components › Load balancer

Load balancer

Spreads requests across downstream instances. Each replica of an app server is its own target, so the algorithm decides which replica serves each request.

Settings

Algorithm
How the next target is picked: round robin takes turns, least connections picks the one with the fewest requests in flight, random picks any, consistent hash sends the same key to the same target.
Health check interval (ms, 0 = off)
How often to probe each target to see if it is alive. A dead target is taken out of rotation. 0 turns checks off, and the balancer keeps sending traffic to dead targets. Minimum 500.
Failed checks to take a target out
How many failed checks in a row remove a target from rotation. Lower reacts faster to a crash but is more easily fooled by a single blip.
Passed checks to bring it back
How many passed checks in a row put a recovered target back in rotation. Higher waits longer before trusting it again.
Routing latency
Time the balancer takes to pick a target and forward a request. It adds directly to every request's latency. Pick the shape: constant, lognormal, exponential, or uniform.
Virtual nodes (consistent-hash)
Only used by consistent hash. Each target gets this many points on the hash ring. More points spread keys more evenly across targets, fewer give lumpy, uneven shares.
Crashes
Scheduled crashes to test failure handling. While one is active, the target refuses requests, and anything it was holding is lost.
About · Contact · Privacy · Terms of use