Try
↑ ↓ move↵ openesc close

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

producers34 / 40queueconsumersdropped 20
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.

Queue depth over time, limit 40
Queue depth over time, limit 40. Text version available below the chart.0132538501 s16 s30 ssimulated timemessages waiting
Wait time of messages that just reached a consumer
Wait time of messages that just reached a consumer. Text version available below the chart.0.01.32.53.85.01 s16 s30 ssimulated timeseconds

What to try

Each one sets up a starting point. Then make the change it describes.

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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