In the game, this was a supermarket checkoutPlay “Checkout Line Captain”
| In the game | In real IT |
|---|---|
| Shoppers | Requests |
| Checkouts 1–3 | Three web servers |
| Slow trainee’s checkout | A weaker server |
| “Closed” sign | A failure found by a health check |
| Flash sale | Traffic spike |
| Line captain | Load balancer |
How does it distribute?
There are three typical methods: round robin, which hands requests out one at a time in turn; least connections, which sends to the server with the fewest requests in progress right now; and weighting, which gives more to higher-performance servers. When an old, weak server is in the mix, weighting gives it less.
Health checks find failures
A load balancer regularly asks each server “are you OK?” (a health check). It stops sending to servers that don’t answer. So even if one breaks, the remaining servers keep the service running.
Get stronger by adding servers
When traffic grows, you add servers and line them up behind the load balancer. This is called scaling out. Unlike scaling up, which makes one server more powerful, its strength is that you can keep adding machines.
- A load balancer spreads requests across several servers
- Health checks remove failed servers
- Scaling out — adding servers — raises capacity