System Design
8. Load Balancing and ScalabilityAnimated
Least Connections
Send to the server with fewest active connections.
The idea
Adapts to uneven request durations by tracking connection counts.
Watch it work
Press play, pause, or step through. Some animations have settings you can change.
- chosen path
- active connections (bar)
Request 1 goes to server 1: it has the fewest active connections (0).
- request:
- 1
- server:
- 1
1/14
The white bar inside each server is its current number of active connections.
Step by step
- 1Track connections per server
- 2Pick the lowest
- 3Forward the request
- 4Update counts when done
Where it is used
Long-lived or varied requests.
Watch out for
Fewest connections is not always lowest load.