Model and Inference EngineeringScheduling and workload mixPrincipal
How should inference autoscaling respond when token demand grows but request rate stays flat?
By Amit Kumar3 min readWorked answer includedReviewed 28 Sept 2026
The question
Interview question
At 100 requests per second, average output length rises from 100 to 1,000 tokens while prompts also become longer. Explain the change in output-token demand and resident KV state, choose observability and scaling signals, and design admission and warm-capacity policies that remain useful during GPU provisioning delays.
Draft your approach first
Take a few minutes before you read the answer. Name the constraint that matters most, the failure you are designing for and how you would know it worked.
Reveal the worked answerWorked answer
Requests per second, often called QPS, counts arrivals rather than the work inside them. One short prompt with a two-line answer and one long context with a thousand-token answer both count as one. Prefill processes the input, decode emits output tokens one step at a time, and active sequences occupy KV cache. NVIDIA's inference metrics separate time to first token, inter-token latency, output token throughput and requests per second for this reason.
For a quick sanity check, 100 requests per second producing 100 output tokens each imply 10,000 output tokens per second in steady state. At the same request rate, 1,000 output tokens each imply 100,000. That is ten times the output-token demand, before we even count a shift to longer prompts. It does not mean you need exactly ten times as many GPUs. Batching, memory bandwidth, attention at longer contexts and the prefill/decode mix change actual capacity. Longer completions also stay resident longer, so concurrent KV occupancy rises even when arrivals per second stay flat.
Residence time connects work to concurrency. In a hypothetical stable system with 100 arrivals per second and an average five-second residence, Little’s law gives 500 in-flight requests. At 50 seconds it gives 5,000. This relation counts all time inside the declared boundary, so separate queue residence from active GPU residency before converting it into cache demand. The model cache retains intermediate attention keys and values for active sequences. Its footprint depends on their current token lengths and sharing, not merely their number.
I would slice traffic by input tokens, generated tokens, context length, model, tenant and priority. Put queue wait, time to first token, inter-token latency, active sequences, KV occupancy, prefill and decode throughput next to the QPS chart. vLLM's metrics documentation gives useful examples of serving-side observability. Check whether the autoscaler reacts to completed QPS, which can even fall under saturation, and whether GPU provisioning takes longer than the workload spike. Kubernetes HPA is a periodic feedback controller, so metric lag and warm-up matter too.
An autoscaler should observe waiting token work and latency risk before relying on successful completions. During overload, the completed-request rate can stay capped while the queue grows. Use measured capacity curves for each model and workload class, scale within actual GPU availability, and include model load, compilation and warmup in the lead time. Admission still needs a bounded queue, request deadlines and a policy for a request that exceeds its estimated output length. Scaling a replica count cannot instantly create a warm device or authorize an unlimited memory commitment.
Capacity planning should use measured throughput and latency curves for representative prompt and output distributions. Scale ahead of predictable rises, reserve headroom for warm GPUs, and set admission and per-tenant budgets for requests that can consume most of the KV pool. Do not promise a precise number of GPUs from token arithmetic alone.
Related questions
Keep practising model and inference engineering
Follow another question in this area, or search the complete library.
Get my essays on AI engineering and distributed systems by email. Subscribe to ArchCrux