Backpressure — a queue that says no
A queue in front of a slow consumer grows until it hurts unless it has a limit. A bounded queue that refuses new work when full tells the producer at once to slow down; an unbounded one hides the problem as ever-longer delays and growing memory. Refusing is a signal; dropping is losing work.
11 minMediumStation: BackpressureMembers lesson
Membership isn’t open yet. The free lessons are open — 16 of them.
- Bulkhead
- Load shedding
- Backpressure
- Rate limiting
- Sale day
What you'll be able to do
- 1Explain how a bounded queue that refuses new work when full tells producers to slow down, and why an unbounded queue only hides the problem.
- 2Predict queue depth and waiting time when producers outpace the consumer, with an unbounded queue and with a bounded one.
- 3Choose what a full queue does — refuse the new item, drop it, or drop the oldest — for a given kind of work.
Inside the lesson
- steps
- 10
- questions
- 7
- simulations
- 3
You guess first, then run the system and see if you were right.
Step 1 · The setup
At the last stop, the gateway refused the excess at once — shoppers were waiting for an answer. Some work doesn't need one straight away; as the Scale line showed, it can wait in a queue for a worker.
Checkout keeps its search index up to date that way. When a supplier imports its catalog, the Catalog API puts an “update the index” job in a queue for each product and tells the importer “accepted” as soon as it's queued. One indexer works through the jobs, 60 a second.
Normally about 20 updates a second arrive; today's import sends 120 a second for 30 seconds. The queue has no limit.
Steps 2–10 are for members
More on the Resilience Line
- Failure modes and availabilityOpen9 min
- Timeouts — capping the waitMembers9 min
- Retries — with backoff and jitterMembers12 min
- Circuit breakerMembers10 min
- Bulkhead — walls between workloadsMembers12 min
- Load shedding — turning the excess awayMembers12 min
- Rate limiting — a budget for each callerMembers12 min