Load Balancing
The algorithm matters less than the health check
Round robin sends each request to the next backend in turn. Simple, predictable, and correct whenever your backends are interchangeable and your requests cost roughly the same.
Least connections sends each request to whichever backend has the fewest in flight. It can adapt when request durations vary, but connection count is only a proxy for load and persistent connections can distort it. Choose from measurements, not from a universal default.
But the algorithm is rarely what determines your availability. The health check is. A balancer that keeps routing to a dead backend will fail a third of requests no matter how elegantly it chooses. Faster checks shorten that window but also raise the risk of ejecting a healthy node during a transient failure.
6 components7 connections0:00
Recording…