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

Offered-load sweep through saturationQueue growth and recovery analysis
1

Read

In this order, only the parts listed

0 of 3 done

  1. Offered-load sweeps with vLLM bench servevLLM v0.31.0 benchmark CLI

    vllm bench serve with --request-rate sweeps across saturation; vllm bench throughput and vllm bench latency for endpoint and phase baselines; keep the raw per-request results with fixed dataset, lengths, warmup and sampling

  2. 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

  3. 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

2

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.
3

Try it yourself

Closed-book, before checking anything

Closed-book, specify a sweep: double the request rate from clearly below to clearly above capacity on a frozen corpus with warmup and three trials per point. Predict the shape: flat p50 to an inflection, then p99 explosion with goodput plateau while completions keep rising late. Then state the recovery check: stop arrivals, measure drain time to empty queue and baseline latency.
4

Quiz yourself

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

0 got · 0 missed

  1. 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. 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. 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. 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 serve with --request-rate for offered-load sweeps, and vllm bench throughput and vllm bench latency for 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-threshold and --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_reason and vllm: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_requests endpoint 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 LoRARequest serving, server-wide --lora-modules with max_loras and max_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, grammar and structural_tag options in StructuredOutputsParams, and the --structured-outputs-config.backend flag.

  • vLLM v0.31.0 multimodal inputsvLLM Project · reference

    Read limit_mm_per_prompt, content hashing with multi_modal_uuids in 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.