Lab · Messaging
Queues & backpressure
A queue lets a producer hand off work faster than workers finish it — for a while. When arrivals stay above what workers can process, something has to give: the queue grows, work is dropped, or the producer is slowed down.
Try it
- Producer — 3 items/s — healthy — sending freely
- Queue — holds up to 12 — healthy — 1 waiting
- Workers × 2 — ~4.0 items/s total — healthy — 2 busy
- Done — 7 — healthy
- Asynchronous
- Request
- Error / rejected
- Response
Queue depth
1/ 12
Utilization
75%
Healthy: healthy headroom
Time in system, (The time within which 95 out of 100 requests finish.)
990 ms
Dropped
0
Waiting at the producer
0
Processed
2/s
Numbers add up:10 arrived = 7 done + 2 in progress + 1 queued + 0 waiting upstream + 0 dropped + 0 in transit · Little's law: 3 in system ≈ 2/s × 0.7 sThe lab checks this sum as it runs, so a counting mistake would show here.
Controls
Show data table
| Time | Items waiting |
|---|---|
| 1s | 0 |
| 1s | 1 |
| 2s | 0 |
| 2s | 0 |
| 3s | 0 |
| 3s | 1 |
ArrivedProcessed
Show data table
| Time | Arrived | Processed |
|---|---|---|
| 1s | 4 | 0 |
| 1s | 2 | 0 |
| 2s | 4 | 4 |
| 2s | 4 | 4 |
| 3s | 4 | 4 |
| 3s | 2 | 2 |
What just happened
Nothing yet. Start traffic or run an experiment.
What this model simplifies
- Items take a random 0.5–1.5× the average processing time and arrive randomly (Poisson). Real traffic is burstier still.
- The unbounded queue "crashes" at 150 items to stand in for running out of memory.
- "Block" pauses the producer instantly. Real backpressure travels through TCP windows, bounded channels, or explicit signals such as HTTP 429 + Retry-After.