How a load balancer works
An animated explainer of load balancing: health checks, round robin and least connections, sticky sessions and autoscaling.
Chapters
- One address: Thousands of people visit one website at once. All their requests go to a single address owned by the load balancer, like a host greeting every guest at the door.
- Health checks: Every few seconds the balancer pings each server. Server C stops answering, so after three missed checks it leaves the pool and gets no more users.
- Picking a server: Then a rule picks a server: round robin takes turns, least connections picks the least busy, and a hash sends each user back to the same server for sticky sessions.
- Round trip & scaling: The request is forwarded, and the reply returns through the balancer. When traffic spikes, autoscaling adds servers and the balancer starts sending them traffic too.
Make an animated explainer of your own topic →