System Design
8. Load Balancing and ScalabilityAnimated
Round Robin
Send each request to the next server in turn.
The idea
The simplest algorithm. Works when requests and servers are similar.
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 2: next server in the rotation.
- request:
- 1
- server:
- 2
1/14
The white bar inside each server is its current number of active connections.
Step by step
- 1Keep a pointer to the next server
- 2Send the request there
- 3Advance the pointer
- 4Wrap around
Where it is used
Uniform workloads.
Watch out for
Ignores server load and request cost.