Try
↑ ↓ move↵ openesc close
In this lesson · topic 3 of 7
  1. 1. Why queues form
  2. 2. Four ways to pick a server
  3. 3. Race four strategies on one arrival stream
  4. 4. Why light load hides a bad balancer
  5. 5. The knee in the queueing curve
  6. 6. Fan-out turns a 1 percent tail into 63 percent
  7. 7. Pick the strategy for the fleet

Topic 3

Race four strategies on one arrival stream

7 min read

Compare the strategies

The lab below starts in compare mode. All four strategies see the same arrival stream, so they are directly comparable. Bars show queue depth per server, and the chart tracks the 99th percentile latency as the run goes on.

Predict before you press play

At 85 percent load, which strategy will have the lowest p99 latency?

ρ = λ / Σμ= 6.68 / 7.86 = 0.85requests per t, t = mean service time

Round robin

p99
12.6t
p50
2.1t
per t
6.17

Random

p99
13.8t
p50
2.5t
per t
5.50

Least connections

p99
14.2t
p50
2.0t
per t
6.17

Power of two choices

p99
15.5t
p50
3.2t
per t
6.00
p99 latency over time
p99 latency over time. Text version available below the chart.0.05.010.015.020.0t=2t=16t=30simulated time (t)p99 (t)

Full-page version with guided experiments: Load balancing lab.

Push the load and the spread

  1. Raise the arrival rate toward 1.00 and watch the bars on Random and Round robin grow first. Then pull it down to 0.40 and see the strategies bunch together.
  2. Raise the speed spread so some servers are slower. Round robin keeps sending the slow servers their equal share.
  3. Raise the service-time variance. Even with the same average cost, a few expensive requests make everyone’s tail worse.
  4. Change the seed. The numbers move a little, but the ordering of the strategies should not.

The full-page lab also has five guided experiments you can apply with one click.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms