LLM Inference Capacity Planning: Why KV Cache, Not FLOPS, Caps Concurrent Chat Users

    When a major AI chat service pauses new paid sign-ups because it has run short of GPUs, the bottleneck is rarely model quality. This article works through the capacity math behind online LLM serving: why the prefill phase is compute-bound while decode is memory-bandwidth-bound, how KV cache consumption sets the real concurrency ceiling, and how to size capacity with Little's Law plus peak headroom. It then covers six levers for raising output per unit of compute — continuous batching, paged KV memory and prefix reuse, quantization, speculative decoding, prefill/decode disaggregation, and tiered admission control — and closes with a set of SLO-driven capacity governance practices. Python snippets show per-token KV estimation, steady-state concurrency estimation, iteration-level scheduling, and per-user rate limiting.

    1. The Lesson: Compute Is the Fixed Capacity of a Chat Service

    In July 2026, a leading conversational AI service announced it would pause new paid memberships because it had run short of compute. The news set off a lot of discussion in developer circles: if the model is good enough, why does the service fall over on “too many users”?

    From a technical standpoint this is not mysterious. Online inference and a conventional web service differ in one fundamental way: a traditional web request costs milliseconds of compute, while generating a medium-length answer with a large model costs seconds to tens of seconds, and that cost scales roughly linearly with output length. GPU capacity is therefore not something you can fix by spinning up more instances — procurement, delivery, and cluster bring-up run on a timescale of months, while traffic growth can run on a timescale of weeks.

    Which leaves a blunt formula in place:

    Peak servable concurrent users ≈ number of available GPUs × effective throughput per GPU ÷ average resource consumption per user

    When the numerator (GPUs) cannot grow in the short term, and the denominator (per-user consumption) keeps rising because contexts get longer, outputs get longer, and agentic multi-turn tool calls multiply, the service operator is left with two options: optimize the denominator (raise output per unit of compute), or restrict the entrance (rate limiting, pausing new sign-ups, tiered quotas).

    Once you understand this background, the interesting question is how to optimize the denominator, because that is the part an engineering team can actually control. That is what this article focuses on.

    2. First, the Basics: One Inference Request Has Two Phases With Completely Different Bottlenecks

    Discussions of “compute shortage” tend to lump everything together, but LLM inference splits naturally into two phases whose performance characteristics point at entirely different hardware capabilities.

    The prefill phase runs the user’s entire prompt through the model in one pass, computing the K/V for every token, writing it into the cache, and producing the first token. This is a large-matrix-multiply-dominated workload with high arithmetic intensity. It is compute-bound and mostly consumes the GPU’s floating-point throughput. It directly determines TTFT (time to first token).

    The decode phase generates tokens autoregressively, one at a time. Each step processes a single new token, but it must read all model weights and the entire KV cache built so far. The arithmetic per token is tiny, yet tens or hundreds of gigabytes of data have to move. It is memory-bandwidth-bound. It determines TPOT (time per output token) — the “typewriter speed” users actually perceive.

    This distinction matters because throughput gains come mainly from batching in the decode phase, and batching works precisely because the decode phase leaves the compute units idle. Fuse the decode steps of 32 users into one batch, and the weights are read once to serve 32 requests. Compute barely increases while bandwidth utilization improves substantially. That is why, in the chatbot era, the resource that sets peak concurrency is GPU memory plus memory bandwidth, not theoretical FLOPS alone.

    3. The Real Hidden Ceiling: Memory Consumed by the KV Cache

    3.1 Where the memory goes

    A single GPU’s memory budget is split roughly four ways:

    1. Model weights: parameter count × bytes per parameter. A 7B-parameter model takes about 14 GB at BF16 and about 7 GB at INT8.
    2. KV cache: proportional to concurrency × average context length. It is the only term that grows linearly with user count.
    3. Activations and transient buffers: related to batch size and sequence length, and usually far smaller than the first two.
    4. Framework and kernel overhead: communication buffers, memory fragmentation, and similar.

    Item 2 is normally what caps concurrency. Its estimate is compact enough to write down:

    1. def kv_bytes_per_token(num_layers, num_kv_heads, head_dim, dtype_bytes=2):
    2. """
    3. Each token needs both a K and a V vector cached per layer.
    4. With GQA/MQA, num_kv_heads is much smaller than the number of
    5. attention heads, which is the most direct structural way to cut
    6. KV memory overhead.
    7. """
    8. return 2 * num_layers * num_kv_heads * head_dim * dtype_bytes
    9. # Example: 32 layers, 8 KV heads, head_dim=128, BF16
    10. per_token = kv_bytes_per_token(32, 8, 128, 2)
    11. print(f"KV bytes per token: {per_token / 1024:.0f} KiB") # 128 KiB
    12. def max_concurrent_contexts(free_vram_bytes, per_token_bytes, avg_seq_len):
    13. return free_vram_bytes // (per_token_bytes * avg_seq_len)
    14. # Assume 60 GiB is left for KV after weights and buffers, average context 8192
    15. slots = max_concurrent_contexts(60 * 1024**3, per_token, 8192)
    16. print(f"Concurrent sequences that fit: {slots}")

    With these numbers, a mid-sized model on a single GPU typically sustains only a few dozen to a few hundred “active long-context” sessions. That is a long way from the common intuition that one GPU can serve thousands of QPS, and the reason is that the dominant cost of a chat service is remembering the conversation, not answering the question.

    3.2 Why the “just drop the KV” idea is sound

    The original discussion contained a sharp observation: a chatbot’s KV cache is disposable. Unlike stateless services such as search and recommendation, the KV cache is not part of correctness — it is purely a performance optimization. Dropping it means at worst recomputing, not returning a wrong answer.

    The strategy also leans on one statistical property of consumer chat traffic: low session reuse and sparse long-range multi-turn iteration. The overwhelming majority of conversations are ask, answer, done, and users rarely return to dig deeper into the same session within the same day. Evicting KV by least-recently-used or idle timeout therefore costs almost nothing in hit rate while immediately freeing memory for new requests.

    Operationally there are three levels of degradation, in increasing order of cost:

    • Offload to host memory: keep the KV and trade PCIe/NVLink bandwidth for time. Suited to sessions likely to return within a few minutes.
    • Offload to local SSD or a remote cache: large capacity, low cost, higher latency. Suited to longer gaps between turns.
    • Drop and recompute: when the context is not long (a few thousand tokens), recomputing the prefill is often cheaper than moving data across media — especially in bandwidth-constrained deployments.

    Two workloads are breaking this assumption. The first is long-running agent tasks, where one session may last hours and carry dozens of tool-call results. The second is enterprise knowledge-base Q&A, where contexts run to tens of thousands of tokens. Under this kind of traffic, KV consumption is tens of times that of consumer chat, so capacity planning has to be modeled per traffic segment; a single blended average will distort the total badly.

    4. From “It Runs” to “It Holds Up”: Doing the Concurrency Math

    What engineering actually needs is a predictable capacity model. Two well-established tools help here.

    4.1 Little’s Law: concurrency = arrival rate × time in system

    This is the plainest and most useful result in queueing theory: the average number of requests in the system L = arrival rate λ × average time in system W. For an online inference service it gives the steady-state concurrency requirement directly:

    1. def estimate_concurrency(qps, input_tokens, output_tokens,
    2. ttft_ms, tpot_ms):
    3. """Estimate the number of concurrent sequences needed at steady state."""
    4. total_latency_s = (ttft_ms + output_tokens * tpot_ms) / 1000
    5. concurrency = qps * total_latency_s
    6. return concurrency, total_latency_s
    7. # Example: 50 QPS, 400 output tokens on average, TTFT 0.5s, 20ms per token
    8. n, lat = estimate_concurrency(50, 1024, 400, ttft_ms=500, tpot_ms=20)
    9. print(f"Per-request latency {lat:.1f}s, concurrent sequences needed {n:.0f}")
    10. # Per-request latency 8.5s, concurrent sequences needed 425

    The implication is important: if one GPU can sustain 100 concurrent sequences, this QPS needs at least 5 GPUs, before any redundancy. And if output length grows from 400 tokens to 2000 — common in agent workloads — time in system multiplies by several times, and the GPU count rises roughly in proportion. This is why product feature evolution “eats” compute budget: it does not change QPS, but it changes the resource consumption of every single request.

    4.2 Peak headroom: never plan on the average

    Online services have to be sized for peak, not mean, with enough buffer to absorb three kinds of variation:

    • Traffic spikes: hot events, notifications, free tiers — short bursts with instantaneous multiples.
    • Long-tail requests: long-context and long-output requests hold KV slots for a long time and push P99 latency up.
    • Capacity jitter: node failures, batch rescheduling, model hot-loading all need reserved room.

    A practical approach is to write capacity planning as a reproducible table: target peak QPS, a tiered distribution of input/output lengths, target P95 TTFT and TPOT, and from those the required GPU count and a headroom factor (commonly 20%–30% reserved), rolled forward week by week.

    5. Six Ways to Raise Output per Unit of Compute

    5.1 Continuous batching and iteration-level scheduling

    Conventional static batching cannot release resources until the whole batch finishes, so mixing long and short requests creates a severe bucket effect: one 4000-token answer holds up an entire batch of already-finished short requests. Continuous batching refines the scheduling granularity from “request” to “decode step”. After every step the scheduler checks whether anything has completed and whether new requests are queued, which keeps the GPU saturated. This has been the single largest source of inference throughput improvement over the past few years, and it maps directly onto the intuition that being a little faster lets you pick up the next user sooner.

    1. def scheduler_step(running, waiting, kv_pool, max_batch_tokens):
    2. """Illustration of iteration-level scheduling: re-batch every step."""
    3. batch = []
    4. used = 0
    5. # 1) Release the KV slot of any request that has just finished
    6. for req in list(running):
    7. if req.finished:
    8. kv_pool.release(req.slot)
    9. running.remove(req)
    10. # 2) Admit new requests from the waiting queue, bounded by
    11. # available memory and the batch token limit
    12. while waiting and len(batch) + len(running) < max_batch_size:
    13. req = waiting[0]
    14. need = kv_pool.estimate_tokens(req)
    15. if used + need > max_batch_tokens:
    16. break
    17. if not kv_pool.try_alloc(req, need):
    18. break # Not enough memory; stop admitting this step to avoid OOM
    19. used += need
    20. batch.append(waiting.popleft())
    21. return running + batch

    5.2 Paged KV memory management and prefix reuse

    Allocating KV memory contiguously per sequence length produces heavy fragmentation, and usable capacity often lands well below the theoretical number. Paged management — split KV into fixed-size blocks and map logical blocks to physical ones through a block table — reduces fragmentation to near-irrelevance and brings an extra dividend: KV blocks with identical prefixes can be shared directly. System prompts, few-shot examples, and long documents repeat heavily across requests, and prefix reuse removes the corresponding prefill compute and memory cost in one stroke. For enterprise knowledge-base workloads, this single optimization frequently beats everything else combined.

    5.3 Lower precision and quantization

    • KV cache quantization (for example FP16 → FP8 or INT8) reduces memory consumption proportionally and is one of the cheapest ways to add concurrency slots. The cost is a very small accuracy loss, which should still be validated on the business evaluation set.
    • Weight quantization (W8A8, W4A16, and similar) relieves weight bandwidth pressure and improves decode-phase TPOT noticeably; smaller weights also leave more room for KV on the same GPU.
    • Structured sparsity and pruning are deeper optimizations with less predictable returns, and quality regressions need careful evaluation.

    5.4 Speculative decoding and kernel fusion

    Decode is serial token by token, so GPU utilization is inherently low. Speculative decoding uses a lightweight draft mechanism to propose several candidate tokens, which the main model then verifies in parallel, confirming multiple tokens in a single forward pass. Acceptance rates are high where output is predictable — formatted output, code, fixed phrasing — and the measured TPOT improvement is often substantial. Fused attention kernels, operator fusion, and CUDA Graphs to remove kernel-launch overhead belong in the same category: low risk, high certainty.

    5.5 Disaggregated prefill and decode, and heterogeneous deployment

    Because the two phases have different bottlenecks, colocating them on the same GPUs makes them interfere: a long-prompt prefill periodically blocks requests that are already decoding, producing latency spikes. Disaggregated deployment (a prefill pool plus a decode pool, connected by KV transfer) lets each workload be configured at its own optimum for parallelism strategy and batch size. Hardware can also be specialized: high-compute cards take prefill, high-bandwidth or large-memory cards take decode. In off-peak windows, spot or preemptible resources can run batch-style offline work such as bulk summarization or evaluation, turning idle capacity into output.

    5.6 Tiered degradation and admission control

    When capacity genuinely falls short, tiered protection beats blanket rejection:

    • Priority queues: paying users go first; free or anonymous requests are admitted only at low load.
    • Dynamic parameters: under high load, automatically lower max_tokens, restrict the context window, and prompt users to split very long inputs.
    • Token bucket rate limiting: enforce per-user rates so a few heavy users cannot crowd out the shared pool.
    1. import time
    2. from collections import defaultdict
    3. class TokenBucket:
    4. """Simple per-user rate limiting: capacity is the bucket size,
    5. refill_rate is the number of tokens replenished per second."""
    6. def __init__(self, capacity: int, refill_rate: float):
    7. self.capacity, self.refill_rate = capacity, float(refill_rate)
    8. self._buckets = defaultdict(lambda: [capacity, time.monotonic()])
    9. def allow(self, user_id: str, tokens: int = 1) -> bool:
    10. tokens_left, last = self._buckets[user_id]
    11. now = time.monotonic()
    12. tokens_left = min(self.capacity,
    13. tokens_left + (now - last) * self.refill_rate)
    14. self._buckets[user_id] = [tokens_left, now]
    15. if tokens_left >= tokens:
    16. self._buckets[user_id][0] -= tokens
    17. return True
    18. return False

    6. Capacity Governance: From Firefighting to SLO-Driven

    Back to the opening event. Pausing new sign-ups is essentially a reactive form of capacity control that protects existing users’ SLOs — it is more defensible commercially than letting everyone’s experience degrade together, but the cost is stalled growth. Mature teams push this kind of reactive decision earlier into proactive capacity governance:

    1. Build an observability baseline: track GPU utilization, memory and KV occupancy, batch size distribution, queueing time, P50/P95/P99 of TTFT and TPOT, tokens produced per GPU per second, and cost per million tokens. Without KV occupancy and queueing time in particular, capacity problems usually surface only when users complain.
    2. Run capacity load tests and find the knee: increase load stepwise and locate the point where throughput stops rising with concurrency (TPOT starts degrading there). Use that knee as the per-GPU capacity baseline rather than the theoretical peak.
    3. Plan per scenario tier: distinguish consumer short chats, long-context Q&A, agentic multi-turn tasks, and batch offline jobs, each with its own length assumptions and SLA.
    4. Set leading signals for scaling: base resource requests on “traffic forecast for the next 4–8 weeks × change in per-request cost” instead of starting the procurement process only after an alert fires.
    5. Coordinate product and engineering: before a new feature ships, assess its impact on token consumption — longer outputs, more turns, larger contexts — and treat compute cost as a product cost that gets reviewed, the same way latency and price do.

    7. Conclusion

    Behind the phrase “compute shortage” sits a set of entirely quantifiable engineering constraints: weights set the floor, the KV cache sets the concurrency ceiling, memory bandwidth sets per-user speed, and the scheduling policy determines how efficiently those resources are used.

    Three conclusions are worth taking away. First, the capacity unit of a chat service is the number of concurrent sequences, not QPS, and that number is determined jointly by memory capacity and context length. Second, the KV cache is a disposable performance optimization; tiered offload and recomputation are effective tools for absorbing traffic spikes, though long contexts and agent workloads weaken this assumption considerably. Third, in the short term you rely on rate limiting and scheduling, in the medium term on quantization and paged prefix reuse, and in the long term on a capacity model rolled forward against SLOs — and only getting the third one right keeps every traffic peak from turning into a public “service paused” announcement.

    If you put this model to work on your own service, and use a general-purpose container platform plus monitoring, alerting, and logging services to collect these metrics, even a small team can establish its own capacity baseline within a week or two — turning the vague anxiety of “do we have enough compute?” into a number you can calculate and verify every week.