DevTools Hub

Search tools

Search for a developer tool

Scalability

Load Balancer Simulator

Compare round robin, least connections, IP hash, and other load-balancing algorithms on the same simulated request pattern.

Part of the Scalability Toolkit
Round Robin
spread 0%

Cycles through backends in order, regardless of their current load.

Server A10 (25%)
Server B10 (25%)
Server C10 (25%)
Server D10 (25%)
Weighted Round Robin
spread 20%

Same cycle, but backends with a higher weight get proportionally more turns.

Server A8 (20%)
Server B8 (20%)
Server C16 (40%)
Server D8 (20%)
Least Connections
spread 20%

Sends each request to whichever backend currently has the fewest active requests.

Server A13 (32.5%)
Server B13 (32.5%)
Server C9 (22.5%)
Server D5 (12.5%)
IP Hash
spread 22.5%

Deterministically maps a client IP to the same backend every time.

Server A8 (20%)
Server B9 (22.5%)
Server C7 (17.5%)
Server D16 (40%)
Power of Two Choices
spread 10%

Picks two random backends and sends the request to whichever has fewer active requests.

Server A8 (20%)
Server B9 (22.5%)
Server C11 (27.5%)
Server D12 (30%)
#Client IPDurationRouted to
010.0.0.71Server A
110.0.0.68Server B
210.0.0.103Server C
310.0.0.76Server D
410.0.0.58Server A
510.0.0.54Server B
610.0.0.24Server C
710.0.0.32Server D
810.0.0.51Server A
910.0.0.47Server B
1010.0.0.32Server C
1110.0.0.14Server D
1210.0.0.67Server A
1310.0.0.32Server B
1410.0.0.75Server C
1510.0.0.82Server D
1610.0.0.84Server A
1710.0.0.88Server B
1810.0.0.37Server C
1910.0.0.23Server D
2010.0.0.52Server A
2110.0.0.26Server B
2210.0.0.62Server C
2310.0.0.31Server D
2410.0.0.77Server A
2510.0.0.38Server B
2610.0.0.84Server C
2710.0.0.46Server D
2810.0.0.108Server A
2910.0.0.78Server B

Showing the first 30 of 40 requests.

What this tool does

Round robin, weighted round robin, least connections, IP hash, and power of two choices all answer the same question — which backend gets the next request — but they produce genuinely different distributions once request cost varies or backends differ in capacity. This tool runs the same simulated sequence of requests (each with a simulated duration and client IP) through all five algorithms side by side, so the difference is a chart instead of a claim.

Why the distributions diverge

Round robin and weighted round robin decide purely from the request's position in the sequence — they never look at how busy a backend currently is. Least connections and power of two choices do look at current load, which is why they stay even even when some requests take far longer than others — a backend stuck on a slow request stops getting new ones until it frees up. IP hash optimizes for something else entirely — not evenness, but stickiness: the same client always lands on the same backend, which is what session affinity depends on.

Reading the results

Each card's bar shows the share of requests each backend received, and the spread figure is the gap between the busiest and quietest backend — 0% means perfectly even. The request-by-request trace underneath shows exactly which backend a given algorithm picked for each simulated request, including its client IP and duration.

FAQ

Why does IP hash have a higher spread than the others?

It's not trying to minimize spread — it's trading evenness for stickiness. With a small client pool, some IPs will hash to the same backend purely by chance, the same way any hash function distributes a small input set unevenly. A larger client pool averages that out.

Why does weighted round robin sometimes look uneven in the trace but even in the chart?

The trace is a sequence of individual decisions; the chart is the aggregate over all of them. Weighted round robin uses a smooth scheduling algorithm (the same one nginx uses) specifically so a weight-2 backend's extra turns are spread throughout the sequence instead of bunched at the start — but the aggregate share still converges exactly to each backend's weight proportion.

Is this simulating real network behavior?

No — it's a simplified, deterministic-per-run model for comparing the algorithms' routing logic, not a network or queueing simulator. Request "duration" is an abstract number of ticks used only to determine which requests overlap, not a real latency measurement.

Is my data uploaded anywhere?

No — everything happens entirely in your browser. Nothing is sent to a server.

Try it yourself

For the full mechanics behind each algorithm — plus Layer 4 vs Layer 7, health checks, and sticky sessions — see Load Balancers Explained. Once requests are spread across backends, Throughput Calculator models how much capacity that pool actually provides.

Related tools