Count requests that satisfy the whole latency contract
Define arrival cohorts and joint TTFT, inter-token, and completion thresholds while keeping raw token throughput, average TPOT, and qualified request goodput distinct.
On this page
The question for today
What you’ll understand
- Compute client-visible TTFT, inter-token gaps, and end-to-end latency.
- Define request goodput over a fixed offered-arrival cohort.
- Distinguish worst-gap qualification from average time-per-output-token metrics.
A server can generate many tokens while delivering too few requests within the promised experience. Goodput attaches usefulness criteria to completed work rather than treating all throughput as equivalent. For generation, the criteria can include time to first token, streaming smoothness, and total completion time. State the exact per-request rule and the offered cohort before comparing schedulers. Rejecting difficult requests or omitting unfinished ones can otherwise make a headline latency or goodput statistic look better while the service actually becomes less useful.
Choose one timestamp boundary and one gap policy
Use a common client-side monotonic clock for the fixture: request start a, first delivered token f, subsequent token timestamps t2 through tm, and terminal completion e. Then TTFT=f−a and end-to-end latency=e−a. Server-side queue and kernel times are useful diagnostic components but are not interchangeable with those client-visible intervals. Buffering can deliver several tokens together, so specify how token timestamps are recovered and how delivery chunks affect any claimed inter-token metric.
For a request with multiple tokens, average time per output token after the first is (tm−f)/(m−1). A maximum inter-token gap is a different statistic and can expose one long stall hidden by that average. Pinned vLLM 0.10.2 benchmark code uses average TPOT in its documented goodput options; this lesson deliberately defines a stricter maximum-gap rule for its worked fixture. For zero- or one-token outputs, define applicability explicitly rather than dividing by zero or silently inventing intervals.
Qualify the whole request within an offered cohort
Select requests whose intended start times lie in a fixed interval [t0,t1), retain every offered identifier, and observe outcomes through a declared drain or timeout policy. A request qualifies only if it succeeds and satisfies all specified latency thresholds. Rejections, errors, cancellations, and missing terminal observations need explicit handling; in this module's goodput fixture they do not qualify. They remain in offered-demand and failure reports, rather than disappearing from the comparison.
Divide qualifying requests from that arrival cohort by the cohort duration for the stated cohort-goodput measure. This differs from counting completions observed in an arbitrary wall-clock window, which can mix earlier arrivals and omit late completions. DistServe motivates optimizing useful request rate under phase-specific latency requirements, but every report must preserve its chosen definitions. Raw output tokens per second can favor long generations and count tokens from requests that fail the latency contract.
Report enough detail to explain a gain
Show offered requests per second, admission/rejection rates, success outcomes, output lengths, qualified request goodput, and relevant per-request latency distributions. Separate tenants or length classes when the mix changes. A system can improve raw token throughput while reducing qualified requests, or raise accepted-request percentile compliance by rejecting more work. Neither outcome is automatically a better service under a fixed demand contract. Preserve the cohort and threshold rules when comparing the baseline and changed scheduler.
The probability lab isolates a hypothetical one-second cohort of twenty requests, each independently qualifying with probability p. Reset, set both p=0.8,n=20, predict sixteen expected qualifying requests, then Play or Step. Reset and set both p=0.5,n=20 for ten. The bars are exact binomial probabilities and playback highlights outcomes rather than running a load test. Real request qualifications can be correlated through shared overload, and the lab measures no TTFT, ITL, completion time, or p99.
Work it through
Separate token throughput from qualified requests
Four successful requests belong to one one-second offered cohort. Their (TTFT,max-gap,E2E) values in milliseconds are A:(50,20,90), B:(80,50,140), C:(120,20,160), D:(40,25,215). Output lengths are 3,3,3,8. Arrivals occur at 0,100,200,300 ms and all terminate before the one-second window ends. Require TTFT≤100, max-gap≤30, and E2E≤200.
A satisfies all three thresholds. B fails the fifty-millisecond gap, C fails first-token delay, and D fails total completion time even though its other two values pass.
Exactly one of four requests qualifies, giving cohort goodput 1/1=1 request/s and an offered-cohort qualification fraction of one quarter.
The outputs total 3+3+3+8=17 tokens. Counting those tokens over the one-second observation fixture gives seventeen tokens/s, but that rate is not seventeen useful requests/s and does not imply all four experiences met the contract.
The fixture has one qualified request per second despite seventeen output tokens per second. Every threshold and the request cohort is part of this conclusion.
The living notebook
Explore the model
Interactive lab · probability
Inspect a hypothetical qualification count
Fresh Reset → set both p=0.8,n=20 predicts mean count 16; Reset → set both p=0.5,n=20 predicts 10. Play or Step highlights exact binomial outcomes, not measured request trials. The independent qualification model has no TTFT, ITL, completion timestamps, load generator, or p99.
- Mean · np
- 5
- Variance · np(1−p)
- 2.5
- Total probability
- 1
These are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forQualified request count needs its own per-request contract and cannot be inferred from token throughput.
Pause & reason
Check your understanding
Your turn
Try it yourself
Using the three gaps above, a contract allows at most fifty milliseconds per gap, while another allows average TPOT at most fifty. Assume success, TTFT, and E2E pass both contracts. Does the request qualify under each?
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Evaluate the same observations with each stated aggregation rather than replacing one rule by the other.
Compare with the solution
The maximum gap is one hundred milliseconds, so the per-gap contract fails. Average TPOT is forty milliseconds, so the average-based contract passes under the other stated conditions. Neither calculation is inconsistent; they answer different service promises. A report comparing schedulers must retain the same rule, and should not cite a benchmark's average-TPOT goodput as evidence for a worst-gap guarantee.
Keep the idea
Take it with you
- Goodput counts completed requests satisfying a declared joint contract.
- Average TPOT, maximum ITL, and latency percentiles are different statistics.
- Keep offered cohorts, rejections, missing outcomes, and token throughput visible in comparisons.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.