Step by step
The example above, written out — the same steps the animation plays.
- 1Round robin. Round robin sends requests to A, B, C, A, B, C… in turn, whatever they are doing.
- 2#1 (slow) → A. A: next in turn. Every slow request lands on A, because they arrive every third tick — exactly in step with round robin.
- 3#2 (slow) → B. B: next in turn.
- 4#3 (slow) → C. C: next in turn.
- 5#4 (slow) → A. A: next in turn. Every slow request lands on A, because they arrive every third tick — exactly in step with round robin.
- 6#5 (slow) → B. B: next in turn.
- 7#6 (slow) → C. C: next in turn.
- 8#7 (slow) → A. A: next in turn. Every slow request lands on A, because they arrive every third tick — exactly in step with round robin.
- 9#8 (slow) → B. B: next in turn.
- 10#9 (slow) → C. C: next in turn.
- 11#10 (slow) → A. A: next in turn. Every slow request lands on A, because they arrive every third tick — exactly in step with round robin.
- 12#11 (slow) → B. B: next in turn.
- 13#12 (slow) → C. C: next in turn.
- 14Done. Most work queued on one server: 9 ticks. Round robin balances the number of requests, not the work.
What's happening?
- Round robin hands requests to each server in turn — fair in count, blind to how heavy each request is.
- Least connections sends each request to the server with the fewest requests in progress, so slow work spreads out.
- When a server stops answering, health checks mark it unhealthy and traffic goes to the others.
Where you'll meet it
Every site with more than one server: AWS ALB, NGINX, HAProxy, Kubernetes Services. It is also what makes rolling deploys possible without downtime.
Common mistake
Keeping user state (sessions, uploads) in one server's memory: the next request may land elsewhere. Keep state in a shared store, or use sticky sessions knowingly.
FAQ
Why did round robin put every slow request on server A?
Slow requests arrived every third tick — in step with the three-server rotation. Real traffic has patterns like this more often than you'd think.
Layer 4 vs layer 7?
Layer 4 balances TCP connections without reading them; layer 7 reads HTTP and can route by path, header or cookie.
What does a health check do?
It regularly asks each server "are you OK?" (or watches for failures) and stops sending traffic to servers that fail.