Course contents
On this page
Lesson plan 34: Tail latency and overload
Explain how queues, retries, and delayed cancellation amplify overload.
Placement: Part 6: Scaling execution and state delivery.
Prerequisites: Lesson 33: Realtime delivery, plus the earlier dependency chain.
Learning outcomes
- Explain how queues, retries, and delayed cancellation amplify overload.
- Choose admission control, bounded queues, batching, and load shedding against deadlines and fairness.
- Calculate backlog growth and recovery while accounting for the service’s spare capacity.
- Separate a general mechanism, a documented implementation choice, and an illustrative numerical assumption.
Teaching sequence
- Establish the motivating situation: A brief overload starts retries that keep the service overloaded after the original spike ends.
- Introduce the vocabulary and the correctness obligation before an optimization. Define admission, queues, batching.
- Develop the mechanism: Follow offered, admitted, and completed work; bound queues and reserve capacity for recovery.
- Follow the complete worked example: A 10000-request queue draining at 2000/s takes 5 s even with no new arrivals. Explain the assumptions, intermediate units, and limiting interpretation.
- Extend the scenario to changed load, skew, or failure, explaining pipelining, shedding, retry budgets, recovery.
- Connect the mechanism to a documented implementation and an alternative with a different workload fit. Close by stating the remaining cost and the next lesson dependency.
Required chapter material
Use a complete execution trace or worked calculation, supported by an annotated static diagram or table. Include language-neutral pseudocode or labeled SQL when it clarifies the mechanism. State preconditions, ownership, visibility, and failure boundaries for algorithms. Describe operational costs as well as the normal path. All questions raised in the narrative must be resolved in the text.
Visual explanation
An offered/admitted/completed-work diagram shows queue growth during overload and a recovery timeline includes continuing arrivals. The accompanying prose explains the arrows, state changes, or table entries so the lesson remains understandable in a plain Markdown reader.
Editorial checks
Confirm that the numerical example agrees with its units and assumptions. Check that a faster path preserves the stated contract, or explicitly identify the changed guarantee. Keep hypothetical figures separate from product measurements. Explain both an appropriate use and a limitation of the case design. Check terminology against the glossary and links against the course index.