Unit 10 of 12 · about 4 hours · measure
Offered-load sweeps through saturation, queue growth and recovery
Every capacity number is a saturation story. Without a sweep that crosses the knee, a single load point cannot tell headroom from overload.
You'll be able to
- Sweep offered load through saturation with fixed corpus, warmup and repeated trials.
- Report queue growth, admission, shedding, tail behavior and recovery from raw per-request records.
- Separate queueing stalls from execution stalls in the saturated regime.
Covers
Read
In this order, only the parts listed
0 of 3 done
- Offered-load sweeps with vLLM bench servevLLM v0.31.0 benchmark CLI
vllm bench servewith--request-ratesweeps across saturation;vllm bench throughputandvllm bench latencyfor endpoint and phase baselines; keep the raw per-request results with fixed dataset, lengths, warmup and sampling - Capacity under strict and relaxed SLOsSarathi-Serve: Tackling Throughput-Latency Tradeoffs in LLM Inference
Section 5 (arXiv:2403.02310v3): capacity as sustainable load under strict and relaxed latency SLOs with Fig 10 and Fig 11; the finding that baseline schedulers violate the p99 TBT SLO before reaching maximum throughput, so relaxing the target raises capacity
- Inflection point and rejection under loadAI Systems Performance Engineering - Chapters 16 and 18, scheduling and admission
Dynamic Batching (pp.991-992): p50 latency staying flat or dropping with throughput up to an inflection point, with SLO-relative batch-delay sizing; Early Rejection (p.1144) with Fig 18-8 instance load under admission control
Focus on
- Drive open-loop with intended-time latency, as the saturation unit in the observability section defines. Closed-loop generation waits for replies and hides the queue you came to measure.
- Saturation has a signature: queue wait passes service time, goodput flattens while offered load climbs, and p99 explodes first. Little's law ties the queue length you see to the wait users feel.
- Recovery is part of the result: after the burst ends, report drain time until the queue empties and latency returns. A system that never drains never recovered.
- Queueing versus execution needs separate evidence. Queue, prefill and decode timestamps per request tell whether the stall sat in WAITING or inside the model step.
Common mistakes · 3
- Calling a closed-loop sweep a saturation test. Self-throttling caps offered load at served load, so the queue never grows past the concurrency limit and the overload an open-loop rate would expose stays hidden.
- Reading capacity off peak throughput without an SLO. Baselines in this unit's papers saturate their latency target first, so the honest capacity is the highest load that still meets TTFT and TPOT.
- Reporting one run per load point. Queueing systems vary run to run near saturation, so single runs confuse noise with the knee; repeat and show the spread.
Try it yourself
Closed-book, before checking anything
Quiz yourself
Answer first, then mark it. Missed ones go to Review.
0 got · 0 missed
1.p50 is flat while p99 climbs steeply with load. Saturated or not?Answer
Entering saturation. The mean still looks healthy because most requests pass, but the tail shows queueing taking over; push further and goodput flattens.
2.Why must the sweep generator be open-loop?Answer
Open-loop arrivals follow the intended schedule regardless of replies, so offered load is independent of served load. Closed-loop waits for replies and throttles itself exactly when the queue forms.
3.How do you tell a queueing stall from an execution stall at high load?Answer
Split per-request time into queue, prefill and decode stamps. Growth concentrated in WAITING is queueing; growth inside model steps with a full batch is execution.
4.The burst ends but p99 stays high for a minute. What do you report?Answer
The drain time: how long the leftover queue took to empty and latency to return to baseline. Recovery behavior, not just the saturated peak.
You're done when
Your sweep shows the inflection with error bars and you explain the saturated regime from per-request stamps, including drain time.
Only when you can do this without notes.
Leads to
Notes
Resources · 3 for this unit, 15 more in the section
- Sarathi-Serve: Tackling Throughput-Latency Tradeoffs in LLM InferenceMicrosoft Research · required
Focus on chunked prefills, stall-free batching and the throughput-latency trade-off. Implement a fixed-token chunk policy and preserve a workload where chunking loses to the simpler scheduler.
- AI Systems Performance Engineering - Chapters 16 and 18, scheduling and admissionChris Fregly (O'Reilly) · required
Read "Dynamic Batching, Scheduling, and Routing" in Chapter 16 and "SLO-Aware Request Management and Fault Tolerance" in Chapter 18 (early rejection, quality of service).
- vLLM v0.31.0 benchmark CLIvLLM Project · support
Use
vllm bench servewith--request-ratefor offered-load sweeps, andvllm bench throughputandvllm bench latencyfor offline endpoint and phase baselines. Fix the dataset, lengths, request rate, warmup and sampling, and keep raw per-request results; do not copy example rates as targets.
Also in this section
- Hands-On LLM Serving and Optimization - Chapter 6, batching and schedulingChi Wang and Peiheng Hu (O'Reilly) · primary
Read "Request Batching and Scheduling-Level Optimizations" in Chapter 6: dynamic, continuous and chunked-prefill batching. Rebuild each policy in a small event simulator and state the user-visible metric it can improve or harm.
- Orca: A Distributed Serving System for Transformer-Based Generative ModelsUSENIX OSDI · required
Study iteration-level scheduling and selective batching, including the workload assumptions. Reproduce one scheduling timeline by hand and use it as the correctness baseline for the simulator.
- Nano-vLLM - Scheduler, Block Manager and Engine LoopGeeeekExplorer · required
Trace scheduler.py with llm_engine.py and block_manager.py. Add event logging in your own fork or project, explain every transition, and implement one bounded admission or chunking change with regression tests.
- Mini-SGLang - Scheduler and Overlap SchedulingSGLang Project · required
Read docs/structures.md, scheduler implementation and tests/core/test_scheduler.py, then compare overlap scheduling with the Nano-vLLM loop. Use the online benchmark only after fixing the same workload and hardware contract.
- AI Systems Performance Engineering - Continuous Batching LabChris Fregly · support
Run the Chapter 15 baseline and optimized continuous-batching pair under CPU-safe or available-GPU settings. Inspect the shared comparison contract and re-measure rather than quoting bundled deltas.
- TensorTonic Language Modeling from Scratch - Simulate Continuous Decode BatchingTensorTonic · support
Solve after the continuous-batching unit, then compare its admission rule with your own simulator.
- LLM Inference: From scratch, one token at a time - Module 05Tushar Amrit · support
Work the Batching module's arithmetic and checkpoint before the static and continuous batching units.
- LLM Inference Systems Laboratory - SchedulerRoadmap-Final · support
Add token and memory admission, chunking, priority, cancellation, overload and fairness to the simulator, then carry one policy through the real engine path with a reference fallback.
- vLLM v0.31.0 serve CLI and scheduler argumentsvLLM Project · reference
Look up scheduler flags and defaults:
--max-num-seqs,--max-num-batched-tokens,--max-num-active-seqs,--enable-chunked-prefill,--long-prefill-token-thresholdand--scheduling-policy. Runtime defaults vary by GPU class, so check them against the installed v0.31.0 behavior. - vLLM v0.31.0 metrics designvLLM Project · reference
Read the WAITING, RUNNING and PREEMPTED request states and the queue, inference, prefill and decode interval definitions. Swapped-preemption metrics are legacy in v1. The exported counters, including
vllm:num_requests_waiting_by_reasonandvllm:num_preemptions, are listed on the Production Metrics page, https://docs.vllm.ai/en/v0.31.0/usage/metrics/ - vLLM v0.31.0 online servingvLLM Project · reference
Read the
/abort_requestsendpoint and the Responses cancel API for request cancellation. Verify client-disconnect aborts on your engine; the page does not cover them. - vLLM v0.31.0 LoRA adaptersvLLM Project · reference
Read per-request
LoRARequestserving, server-wide--lora-moduleswithmax_lorasandmax_lora_rank, and why adapter-slot pressure rewards grouping same-adapter requests. - vLLM v0.31.0 structured outputsvLLM Project · reference
Read the xgrammar and guidance backends, the
choice,regex,json,grammarandstructural_tagoptions inStructuredOutputsParams, and the--structured-outputs-config.backendflag. - vLLM v0.31.0 multimodal inputsvLLM Project · reference
Read
limit_mm_per_prompt, content hashing withmulti_modal_uuidsin Cached Inputs, and the video pruning flags as examples of encoder-side scheduling cost. - TensorTonic Language Modeling from Scratch - Route Cache-Aware Prefill RequestsTensorTonic · support
Solve after the affinity unit: assign each request to a feasible worker by longest cached prefix, lowest projected uncached load, greatest remaining capacity, then lowest worker id, with -1 when infeasible.