Unit 7 of 12 · about 3 hours · explain, implement

Overload, admission, load shedding and retry budgets

Past saturation every accepted request harms admitted ones. Explicit shedding plus bounded retries turns collapse into degraded but predictable service.

You'll be able to

  • Admit by work (tokens and KV), not by count: reject at the edge with 429 before the scheduler degrades everyone.
  • Shed by priority and deadline so premium survives a 10x burst while batch waits.
  • Cap retries with budgets and break circuits so one slow replica stops recruiting the fleet.

Covers

Overload, admission and load sheddingRetry budgets and storm prevention
1

Read

In this order, only the parts listed

0 of 5 done

  1. Load shedding and circuit breakersMachine Learning Systems, Volume 2 - Inference at Scale and Serving Fault Tolerance

    Graceful Degradation, Graceful degradation strategies: Load shedding with priority shedding, admission control at entry and the closed, open and half-open breaker (Figure 30 with 5 failures in 30s and a 60s timeout); Graceful degradation implementation: Listing 1 trigger rules (page read 2026-10-14)

  2. Backpressure under KV pressureMachine Learning Systems, Volume 2 - Inference at Scale and Serving Fault Tolerance

    Load Balancing and Request Routing, Circuit breakers and backpressure: backpressure 503s and the three KV-pressure reliefs (page read 2026-10-14)

  3. Day 24 burst queue notebook100 Days of LLM Inference - Days 22 to 26

    Part 4 InferenceQueue with max_size=150, premium, standard and batch tiers at 30s, 120s and 600s deadlines, burst of 300 over 30s at 1 req/s drain: 150 dropped-full, 22 expired, premium mean 26.05s against its 30s deadline

  4. vLLM waiting-queue signalsvLLM Online Serving, Architecture and Production Metrics

    General Metrics: vllm:num_requests_waiting, vllm:num_requests_waiting_by_reason with capacity versus deferred labels (LoRA budget, KV transfer, blocked status), and vllm:num_requests_running

  5. Project 103 shed ruleAI Infrastructure Engineer Learning - Project 103 LLM Deployment

    Section 10: shed load with 429 once num_requests_waiting passes N, with RateLimitMiddleware keyed by API key returning Retry-After: 60

2

Focus on

  • Admission control rejects at entry what the engine cannot serve. Shedding inside the engine degrades admitted requests too; edge 429 with Retry-After preserves their SLOs and coordinates clients.
  • Random drop treats premium and batch as equals. Shed by declared QoS class and deadline: expire overdue work first, protect interactive classes, make batch wait.
  • A retry without a budget multiplies a partial failure. Cap retries as a fraction of active traffic and break the circuit (open on repeated failure, single half-open probe) so a slow replica fails fast instead of queueing the fleet.
  • capacity waiting means add replicas or shed; deferred waiting means a transient constraint (LoRA budget, KV transfer, blocked status). Shedding fixes only the first; the second needs investigation.
Common mistakes · 3
  • Returning 429 without Retry-After. Clients retry immediately and the shed load returns as a synchronized second wave.
  • Counting requests instead of work at admission. One 100000-token prefill consumes the KV pool that hundreds of short chats would share; admit on tokens and KV, not on count.
  • Half-opening the breaker with full traffic. One probe decides recovery; a flood of probes is just the outage again.
3

Try it yourself

Closed-book, before checking anything

Replay the day24 Part 4 burst from a blank script: 300 requests over 30s into a queue of 150 at 1 req/s drain with the three tier deadlines. Match about 150 dropped-full, 22 expired, and premium mean near 26s inside its 30s deadline.
4

Quiz yourself

Answer first, then mark it. Missed ones go to Review.

0 got · 0 missed

  1. 1.The queue is full and premium, standard and batch requests wait. Which drops first?Answer

    Expired and lowest-class work first: batch past its deadline, then standard over deadline, protecting premium inside 30s. Random drop would sacrifice premium equally.

  2. 2.What do the three breaker states do?Answer

    Closed passes requests and counts failures; open fails fast without touching the sick replica; half-open admits one probe, closing on success and reopening on failure.

  3. 3.Waiting-by-reason shows deferred climbing while capacity is flat. Shed harder or investigate?Answer

    Investigate. Deferred means LoRA budget, KV transfer or blocked status, which shedding does not fix; check adapter load, transfer health and blocked requests.

  4. 4.Why must retries carry a budget during a replica slowdown?Answer

    Each retry re-adds work the sick replica already holds, spreading its queue to healthy replicas. A capped budget plus an open breaker converts the slowdown into fast failures instead of fleet-wide queueing.

5

Practice

  • 100 Days day24: burst shed and breaker drill

    Part 4 burst replay with tier deadlines; Try These Experiments 2: circuit breaker that stops above queue 10 and drains below 5, measured on tails before and after one slowed replica

    Match the drop and expiry counts first, then add a 429-with-Retry-After admission rule and show premium p95 back inside deadline.

You're done when

Your burst replay matches the drop and tier means, and a slowed replica trips the breaker instead of growing every queue.

Only when you can do this without notes.

Leads to

Notes

Resources · 4 for this unit, 9 more in the section

Also in this section

  • Hands-On LLM Serving and Optimization - Chapters 3 and 4, serving system designChi Wang and Peiheng Hu (O'Reilly) · required

    Read Chapter 3 (an online service from scratch, batching with streaming, multi-model trade-offs) and the enterprise-architecture part of Chapter 4. Convert the designs into explicit request, model-lifecycle and failure state machines.

  • vLLM Production MetricsvLLM Project · required

    Define every selected queue, cache, phase and request metric, check histogram buckets and measure exporter overhead. Add model version, cancellation, rejection, quality sample and tenant-safe trace fields in the surrounding service.

  • Inference Engineering - Chapter 7, ProductionPhilip Kiely (Baseten Books) · support

    Read Chapter 7 for containers, autoscaling, cold starts, routing and queueing, zero-downtime deployment, cost estimation and client-side streaming. Skip the vendor section at its end.

  • Gateway API Inference ExtensionKubernetes SIG Network · required

    Study model-aware routing, endpoint selection and operational integration. Use it for architecture and an optional local deployment only after the service passes lifecycle and failure tests without Kubernetes.

  • SGLang documentation - Production MetricsSGLang Project · support

    Compare its metric names and phase boundaries with vLLM's, so your dashboards do not depend on one engine's vocabulary.

  • AI Systems Performance Engineering - Production Inference LabsChris Fregly · required

    Use Chapter 16 monitoring, cache health, capacity planning and load-test utilities, then Chapter 17 routing only if distributed. Add process death, overload and bad-version cases that the performance pairs do not cover.

  • LLM Inference Systems Laboratory - Operations and FailureRoadmap-Final · support

    Complete production gateway, isolation, telemetry, canary, drain, rollback and fault campaigns. Store first-cause timelines and revise runbooks from observed blind spots.

  • OpenAI API Reference - streaming, auth, rate limits and request IDsOpenAI · reference

    Read the chat streaming event shape with the [DONE] terminator, bearer auth, rate-limit headers, and x-request-id with caller-supplied X-Client-Request-Id. vLLM is the implementation under test; use this only for the contract it claims compatibility with.

  • vLLM Multimodal Inputs - media validation, fetch policy and cache identityvLLM Project · reference

    Read Online Serving for image, video and audio inputs: --allowed-media-domains, fetch timeouts, --limit-mm-per-prompt, local-media path restriction, and media UUIDs for cache identity. The link is pinned to v0.31.0.