Load Balancer Simulator
Simulate how round robin, weighted round robin, and least-connections algorithms distribute requests across servers.
Load Balancer Simulator
Servers
- Server 1Weight:
- Server 2Weight:
- Server 3Weight:
Weight only affects the weighted round robin algorithm.
Distribution
- Server 17 requests (35%)
- Server 27 requests (35%)
- Server 36 requests (30%)
How the load balancer simulator works
Simulate how round robin, weighted round robin, and least-connections algorithms distribute a stream of requests across servers.
The three algorithms
- Round robin — cycles through servers in a fixed order, ignoring load.
- Weighted round robin — the same rotation, but servers with a higher weight get proportionally more turns (using the smooth algorithm nginx uses internally).
- Least connections — routes each new request to whichever server currently has the fewest still-active requests.
How to use it
- Pick an algorithm and add or remove simulated servers.
- Set a weight per server (used only by weighted round robin).
- Set how many requests to simulate and how long each one keeps a server busy.
What "request duration" models
Least connections only differs from round robin once requests take more than one tick to finish — that's what lets some servers still be "busy" when the next request arrives, which is exactly the condition least-connections is designed to react to.
Privacy
Runs locally in your browser. No data is sent to the server.
FAQ
Which algorithm should I actually use in production?
Round robin works well when every server is equally sized and requests are roughly equal cost. Weighted round robin suits a mix of server sizes. Least connections tends to perform best when request duration varies a lot.
Is this exactly how a real load balancer works?
It models the core decision logic correctly (including nginx's actual smooth weighted round-robin algorithm), but a production load balancer also handles health checks, connection draining, and session affinity, which this simulator doesn't.
Why does least-connections need a request duration at all?
Without one, every request would be considered "finished" instantly, and every server would always show zero active connections — making least-connections indistinguishable from round robin.
