Queue buffer lab
Bursty producers feed a bounded queue drained by a few consumers. Watch depth, wait time, drops and Little's law while you change the load, the buffer and what happens when it fills.
ρ = λ / (c × μ)= 8.0 / (3 × 3) = 0.89messages per second. Bursts push the rate above this for a few seconds at a time.
Drop the newest
- waiting now
- 34peak 40
- dropped
- 207.6%
- mean wait
- 1.7s
- held by producers
- 0
L = λ W14.68 vs 8.13 × 1.66 = 13.50L: queue depth averaged over time. λ: messages admitted per s. W: mean time in the queue.
| Series | Latest | Lowest | Highest |
|---|---|---|---|
| Drop the newest | 34 | 0 | 40 |
| Series | Latest | Lowest | Highest |
|---|---|---|---|
| Drop the newest | 4.0 | 0.0 | 4.0 |
| Policy | Waiting | Peak | Arrived | Dropped | Held by producers | Done | Mean wait (s) | Mean latency (s) | Busy share | L | λ | W | λ × W |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Drop the newest | 34 | 40 | 264 | 20 | 0 | 207 | 1.66 | 1.97 | 80% | 14.68 | 8.13 | 1.66 | 13.50 |
What to try
Each one sets up a starting point. Then make the change it describes.
A buffer absorbs a burst
Set the buffer to 200 with bursty traffic well under capacity, then watch the depth chart through a few bursts.
Look for. Depth climbs while a burst lasts and drains in the quiet time after it. Nothing is dropped, because the buffer is deeper than any burst.
A small buffer drops the same burst
Keep the same traffic and shrink the capacity to 10.
Look for. The queue hits its limit in every burst and throws messages away, although the consumers are idle most of the time.
Sustained overload fills any buffer
Set the producer rate above the consumers' combined speed with steady traffic. Then add consumers until the rate falls below capacity.
Look for. Depth rises until it reaches the limit and stays there, and the dropped share settles near the excess. Once the consumers can keep up, the queue empties again.
A bigger buffer only adds waiting
Under the same overload, raise the capacity to 300 and compare the wait with a capacity of 20.
Look for. Throughput does not change and the dropped share barely moves. Messages now wait far longer before they are processed. Check L, λ and W: all three grow or shrink together.
Choose what a full queue does
Compare all three policies under overload and read the queue pictures, the wait and the held-back count.
Look for. Block drops nothing but the producers fall further behind without limit. Drop the newest keeps old messages and refuses new ones. Drop the oldest serves fresher messages with a shorter wait.
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