Unit 8 · AI infrastructure · Lesson 10 of 10
Serving metrics: goodput, TTFT and inter-token latency
Step 1: Learn the ideas
- Time to first token and its components (queueing, prefill, network)
- Inter-token latency versus time per output token; streaming
- End-to-end latency and its dependence on output length
- Throughput in requests per second versus tokens per second
- Goodput and SLO attainment
- Percentiles, tails and sample sizes
- Open-loop versus closed-loop load generation; coordinated omission
- Arrival processes and length distributions from traces
- Failures, timeouts, preemptions and fairness across tenants
- Capacity planning with Little’s law
Why it matters
Throughput alone hides what users experience. LLM serving is judged by time to first token, the pace of streamed tokens, end-to-end latency and the rate of requests served within those targets, reported as percentiles at a stated load. Precise definitions and honest measurement separate a useful benchmark from a misleading one, and interviewers test both.
Core ideas
Definitions (state them, because tools differ).
- Time to first token (TTFT): from request submission to the first output token. It includes queueing and prefill and, when measured at the client, network and tokenization.
- Inter-token latency (ITL): the gap between consecutive streamed tokens. Time per output token (TPOT) is usually a request's average after the first token, (end-to-end latency − TTFT) / (output tokens − 1). Some tools include the first token or average over tokens rather than requests.
- End-to-end latency: TTFT plus generation time. It scales with output length, so compare at similar lengths or use per-token metrics.
- Throughput: requests per second, output tokens per second, or total tokens per second. Prefill-heavy and decode-heavy workloads give very different numbers on the same system.
Goodput. Following DistServe, goodput is the request rate a system sustains while a target fraction of requests meets every SLO, for example both a TTFT bound and a TPOT bound. Raw throughput can rise while goodput falls: a bigger batch produces more tokens per second but pushes TPOT past its bound.
Percentiles and tails. Report p50, p90 and p99 together with the number of requests behind them. Tails come from queueing, long prompts, preemption and stalls. A p99 computed from a few hundred requests rests on a handful of observations, so use enough requests and repeat runs.
Load generation. A closed-loop client (a fixed number of users, each waiting for its response) lowers its arrival rate when the server slows, so it never records the queueing delay that independent users would have seen; this measurement error is known as coordinated omission. An open-loop generator issues requests at a set rate, often Poisson or with tunable burstiness, independent of responses. Sweep the rate from light load to past saturation and plot latency percentiles against achieved throughput; the knee is where queueing grows sharply. It is the same latency-versus-load method used for key-value stores such as memcached.
Realistic workloads. Prompt and output length distributions, shared prefixes and burstiness drive results. Public traces such as the Azure LLM inference traces provide arrival times and token counts to replay.
Failures and fairness. Count rejected, timed-out and failed requests; dropping them from latency statistics makes overload look healthy. Report per-tenant or per-request-class percentiles, because one tenant's long prompts can inflate everyone's TTFT through head-of-line blocking.
Server-side breakdown and capacity. Engines expose queue time, prefill time, decode time and KV-cache usage; use them to explain client-side percentiles. Little's law (concurrency = arrival rate × time in system) connects a measured goodput curve to the number of replicas needed for a peak rate with headroom.
Common misconceptions
- "More tokens per second means a better system." Without latency SLOs and the load level, throughput can be bought with unacceptable TPOT; compare goodput under the same SLOs.
- "Average latency is enough." Averages hide bimodal behavior such as preemptions or cold caches, and users feel the tail.
- "N concurrent clients measure capacity." Closed loops hide queueing; use open-loop arrival rates for latency-under-load curves.
- "TTFT measures model speed." Under load it is mostly queueing; separate queue time from prefill time with server metrics.
- "Failed requests can be left out." Report them; otherwise overload looks like low latency.
How to approach it
Write a benchmark plan before running: model, hardware, engine version and settings, workload source, arrival process, rates to sweep, warm-up, duration, repetitions, metric definitions and percentiles, SLOs for goodput, and how failures are counted. Then present the latency-throughput curve with the knee marked. In interviews, define each metric before quoting any number.
Suggested order
- 1Read NVIDIA’s NIM benchmarking metrics page and write your own one-line definition of each metric, noting where tools differ.
- 2Read DistServe’s introduction and evaluation setup for the definition of goodput under TTFT and TPOT targets.
- 3Read the Service Level Objectives chapter of the Google SRE book and translate its ideas into LLM serving targets.
- 4Read vLLM’s benchmark CLI and production metrics pages to learn which client-side and server-side metrics you can collect.
- 5Do the serving benchmark project with an open-loop rate sweep, percentiles, goodput and a length distribution taken from the Azure LLM inference traces.
Step 2: Check off what you can do
Tap each one you can genuinely do or explain. Each earns 10 XP.
Step 3: Go deeper
DistServe: Disaggregating Prefill and Decoding for Goodput-optimized Large Language Model ServingStart here
USENIXGoodput as SLO-constrained throughput and why TTFT and TPOT targets pull serving designs in different directions.
Open(opens in a new tab)Link responded, 5 Oct 2026NVIDIA NIM LLM Benchmarking: MetricsStart here
NVIDIA DocumentationPrecise metric definitions and the places where benchmarking tools disagree.
Open(opens in a new tab)Link responded, 5 Oct 2026vLLM documentation
vLLM projectSection: CLI: vllm bench serve
A practical load generator with request-rate, burstiness, concurrency limits, percentile and goodput options.
Open(opens in a new tab)Link responded, 5 Oct 2026Site Reliability Engineering (Google SRE book)
Google (free online edition)Section: Ch. 4: Service Level Objectives
How to choose indicators, objectives and percentiles, applied here to TTFT and TPOT.
Open(opens in a new tab)Link responded, 5 Oct 2026Azure Public Dataset
Microsoft Azure and Microsoft Research (GitHub)Section: Azure LLM inference trace 2023
Real arrival times and prompt and output token counts for trace-driven serving benchmarks.
Open(opens in a new tab)Link responded, 5 Oct 2026
Step 4: Practice
Write the benchmark plan first (definitions, arrival process, rates, warm-up, repetitions, SLOs). Run an open-loop sweep with a serving engine and a small open model, record TTFT, TPOT and end-to-end percentiles, achieved throughput, failures and goodput at each rate, and mark the knee. Repeat at least one rate several times to see run-to-run variance. If you ran memcached latency-versus-load experiments before, compare that method with this one and note what you would change.
- Benchmark an LLM server under open-loop load and report goodputOpen(opens in a new tab)Not attemptedSelf-directed (vLLM or another serving engine)
- Re-run and document one of your cloud coursework experimentsOpen(opens in a new tab)Not attemptedSelf-directed (your coursework setup)
Record attempts on each problem’s page (+15 XP, +10 more when solved on your own).
Step 5: Test yourself
Answer each one out loud or on paper before you finish the lesson.
- Question 1Why can throughput rise while goodput falls?
- Question 2What makes up TTFT at low load, and at high load?
- Question 3How many requests do you need before a p99 means something?
- Question 4What is the difference between open-loop and closed-loop load generation?
- Question 5How would you detect unfairness between tenants?
- Question 6How does Little’s law help size a serving fleet?
You’re done when you can
- Define TTFT, TPOT, inter-token latency and end-to-end latency precisely and explain how two tools could report different TPOT for the same run.
- Compute goodput for a run from per-request TTFT and TPOT and a stated SLO.
- Produce a latency-versus-throughput plot from an open-loop sweep and explain its knee.
- Explain coordinated omission and how your load generator avoids it.
- Report failures and per-class percentiles alongside headline numbers.


