LLM Serving Compute Bottlenecks: Causes and Mitigation Strategies

    This article explains why compute capacity, mainly GPU compute and memory, sets the peak concurrency limit for large language model serving. It presents a reusable capacity estimation framework, four practical mitigation approaches covering cache lifecycle management, batching and scheduling, cache reuse, and elastic scaling with admission control, plus the observability needed for capacity governance. The key takeaway is to quantify first, optimize second, and scale out last.

    1. The Root Cause: Compute Sets the Peak Concurrency Ceiling

    When an AI assistant service pauses new membership sign-ups during traffic peaks, the reason is not mysterious from an engineering perspective. In chatbot scenarios, the resource that actually limits the number of concurrent users is usually neither storage nor network bandwidth, but the compute and memory capacity of accelerators (GPUs). The reason is straightforward: the server must maintain context state for many sessions at the same time, each active session occupies its own cache, and generation itself advances token by token in a serial manner.

    You can think of inference serving as an assembly line: take one user’s request, load its context cache, keep producing tokens until the request finishes, release the cache, and then load the next request. Under ideal conditions, the accelerator runs at full utilization close to the bottleneck, so “how many accelerator resources you have” almost linearly determines “how many sessions can be maintained simultaneously at peak.” This point from the original text is the prerequisite for understanding all the optimization techniques that follow.

    Two additional constraints deserve attention, because the model above is simplified. First, the decoding phase is limited by memory bandwidth, so compute utilization may fall far short of the theoretical peak. Second, the longer the context, the higher the cost of attention computation and cache reads, so the per-request cost rises nonlinearly with length.

    2. Quantifying the Constraint: A Reusable Capacity Estimation Framework

    Capacity planning should not rely on guesswork. A rough model can be built with the following parameters (values are illustrative and must be validated with your own load tests):

    • Per-GPU memory capacity M_total, with framework and weights permanently occupying M_base;
    • Per-token cache usage m_kv (related to the number of layers, attention heads, head dimension, and precision);
    • Target concurrent sessions C and average context length L;
    • Average output length per request T_out and target end-to-end latency SLO.

    The memory-side constraint can be approximated as:

    1. C * L * m_kv + M_base <= M_total * utilization

    The throughput-side constraint can be written as:

    1. C * T_out / SLO <= aggregate_token_throughput

    The intersection of the two gives the sustainable concurrency range on the current hardware. The value of this framework is that when a stakeholder asks to “double the number of members,” you can immediately answer how many GPUs to add, how much to compress the average context length, or how much to improve the cache hit rate, instead of making a promise that cannot be verified.

    3. Four Practical Mitigation Approaches

    3.1 Cache Lifecycle Management

    The cache is the direct denominator of concurrency. In engineering terms, you should release it immediately when a request ends, reclaim it after an idle timeout, retain it by session priority tier, and cap extremely long contexts. Example logic:

    1. def release_policy(session, now):
    2. if session.finished or now - session.last_active > IDLE_TTL:
    3. free_kv_cache(session) # return memory immediately
    4. elif session.tokens > MAX_CONTEXT:
    5. truncate_or_summarize(session) # compress context to reduce per-session usage

    3.2 Batching and Scheduling

    The core idea of continuous batching is “whoever finishes leaves, and new requests can join at any time,” avoiding a whole batch waiting for the slowest request. Combined with chunked prefill, the prefill of long inputs can be sliced and scheduled together with decoding steps, flattening latency spikes. The scheduler needs explicit priorities: paid or high-priority sessions first, while low-priority requests queue or get downgraded.

    3.3 Cache Reuse and Prefix Sharing

    Many requests share the same system prompt and tool descriptions, and this prefix cache can be reused to significantly reduce repeated computation. On the business side, semantic caching is also possible: return existing results directly for high-frequency similar questions, turning compute consumption from “generate every time” into “generate once, hit many times.”

    3.4 Elastic Scaling and Admission Control

    Using a composite scaling metric of “queueing delay + decoding throughput + memory watermark” is closer to the real experience than looking at utilization alone. Admission control is also essential: when the watermark exceeds a threshold, new sessions are queued, downgraded to a model with fewer parameters, or some entitlements are temporarily disabled. This is the generalized form of “pausing sign-ups.” The key is to productize the policy in advance rather than passively throttling only after a collapse.

    4. Observability and the Capacity Governance Loop

    Without measurement there is no optimization. At minimum, collect active session count, cache usage and hit rate, input and output length distribution, time to first token and per-token latency, queueing time, and cost per token. With these metrics, you can form a loop of “load test, model, scale out or optimize, review.”

    For cloud implementation, you can combine a container platform to host elastic replicas, object storage to hold models and datasets, a message queue to smooth request peaks, and logging and monitoring with alerting for observability. Baidu AI Cloud provides standard categorized components for these general capabilities, and enterprises can combine them freely based on their own load test results rather than being tied to a fixed architecture.

    5. Conclusion

    Compute pressure is not a PR incident, but the inevitable exposure of a capacity planning problem amplified by traffic. Only by writing peak concurrency as a formula, managing the cache as a first-class citizen, and making scheduling and admission control tunable policies can you stay in control along the growth curve. For developers, the most practical mindset is: quantify first, optimize second, and only then talk about scaling out.