BLOG / CAPACITY PLANNING

The real capacity of an inference server

Model fit, active-sequence capacity, and sustainable request rate are different limits. A memory budget is only the start of capacity planning.

“How many requests can this GPU handle?” has no useful answer until we specify what those requests do and when their answers must arrive. A server can fit the model, admit dozens of sequences, and still miss the product's latency objective.

Capacity is an operating envelope: a workload and arrival rate the server can sustain within a service objective. Weight fit and KV capacity constrain that envelope. Neither establishes it.

A loaded model establishes only the first limit

Weight size is the obvious starting point. It is not the whole GPU memory budget. Runtime allocations can include activations, temporary workspaces, communication buffers, and captured execution graphs. The remaining space supports the KV cache and other request state.

For a conventional decoder whose layers have the same KV shape, the uncompressed state per token is approximately:

KV bytes per token = 2 × layers × KV heads × head dimension × bytes per value

The factor of two accounts for keys and values. Use KV heads rather than query heads for grouped-query attention. Architectures with latent attention, local windows, or different layer types need their own calculation.

Paging reduces allocation waste and permits useful sharing, as described in the PagedAttention paper. It does not make the required state for a distinct token disappear.

Three distinct capacity questions: model fit, active KV state, and sustainable arrivals within a latency objective.
Three distinct capacity questions: model fit, active KV state, and sustainable arrivals within a latency objective.

Resident tokens are the scarce allocation

Consider a hypothetical server with 48 GiB available for KV. Its model has 32 layers, eight KV heads per layer, head dimension 128, and two-byte cache values.

The formula gives 131,072 bytes, or 128 KiB, per token. Dividing 48 GiB by 128 KiB gives 393,216 resident token positions across requests, before block rounding or additional cache metadata.

Resident context per sequenceKV per sequenceIdeal number of sequences
4,096 tokens0.5 GiB96
8,192 tokens1 GiB48
32,768 tokens4 GiB12

These are equal-length, unshared allocations. They are not user-count promises or measured throughput. A real workload mixes lengths, and generated tokens enlarge each sequence's resident context.

Now admit 48 requests at 8,192 resident tokens each. The ideal KV budget is full. If they all continue generating, their next tokens need additional state. The engine must have retained headroom, reclaim other state, or use its preemption policy. “48 fit” describes a snapshot, not a promise that all 48 can finish uninterrupted.

Block-based allocation avoids reserving every request's configured maximum upfront, but does not remove future growth. Admission needs a policy for that growth: conservative reservation, workload-based headroom, or explicitly accepted preemption. The policy determines what the advertised concurrency means.

Memory slots do not establish request rate

Suppose 48 sequences fit. Whether the server can keep up depends on how long each remains active and how much work new arrivals bring.

For a stable system, Little's law relates averages: L = λ × R. Here L is the mean number of requests inside a consistently defined boundary, λ the mean completed request rate, and R the mean time spent inside that boundary.

If we define the boundary as admission through completion, 48 active requests with a hypothetical mean residence time of two seconds correspond to 24 completions per second. At eight seconds, the same occupancy corresponds to six. This is an accounting identity under stable conditions, not a way to predict either residence time from memory size.

If the boundary includes the queue, waiting requests must be counted too. Mixing active GPU occupancy with end-to-end response time gives a misleading calculation.

The important consequence is that output length belongs in capacity planning. A server producing short classifications and one producing long explanations can have the same model and memory budget but different sustainable arrival rates.

Test whether the queue recovers

A queue lets a server accept work faster than it completes it for a while. A short run may end before the debt becomes visible. Look for a queue that returns to its normal range after a burst, rather than one that keeps growing while throughput appears steady.

Use a representative arrival process independent of completion. A test that sends each new request only after the previous one finishes reduces its own offered rate when the server slows. That can be appropriate for a fixed-user workload, but it does not establish capacity for an independently arriving request stream.

State first-token and completion-time limits, the percentiles at which they must hold, and the acceptable failure rate before testing. Count useful completed requests that meet the deadlines. Include rejected, cancelled, and timed-out work in the offered-load accounting so that shedding requests cannot masquerade as additional capacity.

Write a capacity claim someone can use

A useful claim has four parts: configuration, workload, arrival pattern, and service objective. Attach the tested request rate, run duration, and observed latency distribution. Specify prompt and output lengths, cache reuse, and burst behavior; these determine whether the result transfers to the intended traffic.

Track KV occupancy and preemptions alongside queue age. If memory pressure rises first, investigate state growth and admission. If queue age grows with free KV remaining, memory fit is not the active limit; inspect execution time and scheduling.

The number to operate below is the sustained rate that satisfies the service objective, with headroom chosen for the traffic's variability. Report the maximum active sequences as a separate allocation limit. Keeping those numbers separate prevents a memory calculation from becoming an accidental service guarantee.

What to remember

  • Weight fit, active-state fit, and sustainable request rate answer different questions.
  • Budget for context growth after admission; a full snapshot leaves no room for the next token.
  • Use queueing relationships with consistent boundaries and stable workloads.
  • State configuration, workload, arrival pattern, and service objective with every capacity claim.

← Back to Blog