Load shedding lab
Push more traffic at a server than it can serve, and compare an unbounded queue with a bounded queue, deadline-aware drop and adaptive LIFO by the work that finishes in time.
offered = 6.0 per tcapacity = 4 per tload 1.50x · client timeout 10 t · t = one mean service time
Unbounded FIFO
31 waiting
- goodput vs capacity
- 71%
- queue delay
- 2.8t
- timeout
- 10t
answered late 0 · rejected 0 · dropped 0 · expired 0
Bounded queue, reject
18 waiting
- goodput vs capacity
- 69%
- queue delay
- 3.0t
- timeout
- 10t
answered late 0 · rejected 15 · dropped 0 · expired 0
Deadline-aware drop
35 waiting
- goodput vs capacity
- 66%
- queue delay
- 3.0t
- timeout
- 10t
answered late 0 · rejected 0 · dropped 0 · expired 0
Adaptive LIFO
20 waiting
- goodput vs capacity
- 73%
- queue delay
- 0.2t
- timeout
- 10t
answered late 0 · rejected 0 · dropped 0 · expired 10
| Series | Latest | Lowest | Highest |
|---|---|---|---|
| Unbounded FIFO | 65% | 8% | 65% |
| Bounded queue, reject | 64% | 5% | 64% |
| Deadline-aware drop | 60% | 6% | 60% |
| Adaptive LIFO | 66% | 6% | 66% |
| Series | Latest | Lowest | Highest |
|---|---|---|---|
| Unbounded FIFO | 2.6 | 0.1 | 2.6 |
| Bounded queue, reject | 2.8 | 0.0 | 2.8 |
| Deadline-aware drop | 2.7 | 0.1 | 2.7 |
| Adaptive LIFO | 0.2 | 0.1 | 0.2 |
| Series | Latest | Lowest | Highest |
|---|---|---|---|
| Best possible | 100% | 50% | 100% |
| Unbounded FIFO | 0% | 0% | 59% |
| Bounded queue, reject | 106% | 48% | 108% |
| Deadline-aware drop | 100% | 48% | 104% |
| Adaptive LIFO | 106% | 48% | 108% |
Events: capacity at 1x.
- Unbounded FIFO: goodput 71% of capacity, 31 waiting, queue delay 2.8 t (p99 5.5 t), answered late 0, rejected 0, dropped 0, expired in the queue 0.
- Bounded queue, reject: goodput 69% of capacity, 18 waiting, queue delay 3.0 t (p99 5.5 t), answered late 0, rejected 15, dropped 0, expired in the queue 0.
- Deadline-aware drop: goodput 66% of capacity, 35 waiting, queue delay 3.0 t (p99 6.1 t), answered late 0, rejected 0, dropped 0, expired in the queue 0.
- Adaptive LIFO: goodput 73% of capacity, 20 waiting, queue delay 0.2 t (p99 0.9 t), answered late 0, rejected 0, dropped 0, expired in the queue 10.
| Policy | 0.5x | 0.75x | 1x | 1.25x | 1.5x | 2x | 2.5x | 3x |
|---|---|---|---|---|---|---|---|---|
| Unbounded FIFO | 48% | 59% | 0% | 0% | 0% | 0% | 0% | 0% |
| Bounded queue, reject | 48% | 59% | 104% | 108% | 106% | 106% | 106% | 106% |
| Deadline-aware drop | 48% | 59% | 104% | 104% | 100% | 102% | 100% | 100% |
| Adaptive LIFO | 48% | 59% | 104% | 108% | 106% | 106% | 106% | 106% |
What to try
Each one sets up a starting point. Then make the change it describes.
Overload with no limit on the queue
Keep the offered load at 1.5 and compare all four policies. Watch the goodput chart and the queue delay chart.
Look for. The unbounded queue works at first. Once its queue delay passes the client timeout, every request it serves is one the client already gave up on, and goodput falls to nothing while the server stays busy. The other three keep goodput near capacity.
Stay under capacity
Set the offered load to 0.7.
Look for. Nothing collapses. All four policies finish almost everything, and queue delay stays small. Shedding policies only matter when there is more work than capacity.
A bounded queue that is too big
Pick the bounded queue alone and set its size to 200. Then set it back to 20.
Look for. A queue that holds more than timeout times capacity can fill with requests that will expire before they reach a worker, so it behaves like an unbounded one. The size has to be chosen from the timeout.
Cut the client timeout
Set the client timeout to 4 and compare all four.
Look for. The bounded queue of 20 now holds more waiting time than the clients will give it, so it starts failing too. The deadline-aware policy needs no tuning because it checks each request against its own deadline.
Serve the newest first
Pick adaptive LIFO alone at 2.0 times capacity and read the queue delay and the expired count.
Look for. Served requests wait almost no time, because the newest request is the one with the most patience left. The price is that old requests are never served. They sit until they expire, so some users wait for nothing.
New to the idea? Read the lesson first. Every number here comes from a seeded simulator, so the same seed gives the same run.
Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms