Queue / Backpressure
Push producers against a bounded buffer and watch drop, block, or overwrite under overload.
In queue
0
Dropped
0
Produced
0
Status
Filling
Queue depth over time (s = sim seconds)
Filling In queue Dropped (cumulative)
In queue = produced − consumed − dropped. With drop/overwrite the buffer pins at capacity and dropped climbs; with block the producer simply stops, so produced flattens instead.
How this simulator works
Producers push into a bounded buffer; consumers drain it. When production outruns consumption the buffer fills, and the overflow policy decides what happens to the surplus.
The three policies
- Drop — excess messages are discarded (UDP-style, fire-and-forget).
- Block — the producer stalls until there is room (backpressure propagates upstream).
- Overwrite — oldest messages are evicted to make room (ring buffer, e.g. metrics).
Little’s Law
Steady-state in-flight ≈ arrival rate × average time-in-system. Raise the consume rate above produce and the queue drains; the reverse and it grows without bound (until the policy caps it).