Compute Bottlenecks and Capacity Planning for LLM Chat Services

    This article explores capacity governance challenges in LLM chatbot services, moving beyond simple user account metrics to focus on effective token throughput and concurrent session management. It covers request lifecycle phases (prefill and decode), continuous batching trade-offs, and the design of a tiered, elastic KV cache system. Additionally, it provides practical strategies for capacity estimation, admission control, system degradation, and monitoring to help maintain service stability and user experience during periods of compute resource constraints.

    Compute Bottlenecks and Capacity Planning for LLM Chat Services

    Recently, some chatbot services have paused new member access due to compute shortages. While appearing as an operational tactic, this is fundamentally a capacity governance issue: given specific GPU resources, VRAM capacity, and network/storage bandwidth, how many peak concurrent users can the system stably support, and at what pace should new capacity be released? For chatbots, user experience is determined by first-token latency, subsequent token generation rate, queue time, and session continuity. Resource constraints typically focus on GPU compute, VRAM bandwidth, KV cache footprint, batch scheduling efficiency, and cache reload chains. This article discusses how to understand compute bottlenecks, design an evictable and rebuildable cache system, perform capacity estimation and admission control, and provides actionable monitoring and degradation strategies.

    1. The Core Problem: Peak Concurrency is About Active Generation, Not Registered Users

    LLM chat services differ significantly from traditional request-response web services. A conversation request is not completed in milliseconds but requires autoregressive token-by-token generation lasting from seconds to tens of seconds. The “typing…” indicator visible to the user represents continuous GPU compute and VRAM bandwidth occupation during the decode phase. Therefore, peak capacity is determined not by total registered users or daily active users, but by the number of sessions actively generating tokens within a time window, along with their average context length, average output length, and required generation rate.

    Service capacity can be roughly estimated as: under target first-token latency and generation rate, the total effective tokens per second the GPU cluster can produce, divided by the average token consumption rate per session, minus scheduling overheads, long-tail requests, and safety margins. This estimation is a planning starting point, not a substitute for load testing, as real-world systems face factors like batch efficiency, VRAM fragmentation, request length distribution, cache hit rates, and network/storage jitter. However, it reveals a key conclusion: the pace of opening member access must be tied to committed token throughput, not merely account counts.

    When concurrent demand exceeds stable token throughput, continued access rollout manifests as longer queues, rising first-token latency, and declining generation speeds, potentially triggering timeout retries that further amplify the load. Pausing member access is essentially an admission control measure protecting the SLA of existing users while buying time for scaling, cache optimization, and scheduling improvements.

    2. Request Lifecycle: Prefill, Decode, and Continuous Batching

    LLM chat requests typically involve two phases. The prefill phase performs forward calculations on user input and conversation history, establishing context representations and generating the KV cache. The decode phase generates output token by token, processing only one new token at a time while reading the historical KV cache. Prefill is compute-intensive, while decode is more sensitive to VRAM bandwidth, batch size, and cache management efficiency. For long-context, multi-turn dialogue scenarios, KV cache capacity and access efficiency directly impact the number of concurrent sessions the system can maintain.

    To improve GPU utilization, servers typically employ continuous batching: different requests can join a batch at different times, completed requests exit promptly, and new requests fill the slots. This maximizes “total tokens generated per second” but introduces scheduling complexity. Larger batches may yield higher throughput, but make single-request latency and VRAM usage harder to control; smaller batches offer better latency control but increase per-token costs. Capacity planning must balance these factors and reserve space for long-tail requests.

    A simplified admission logic can be represented as follows. It expresses the idea of “checking throughput levels first, then cache and queue policies,” rather than a specific product interface:

    1. def admit_request(req, gpu_pool, cache_store, slo):
    2. # Estimate the token throughput required for this request in the current window
    3. required_rate = estimate_token_rate(req.history_len, req.max_output)
    4. available_rate = gpu_pool.effective_token_throughput() * (1 - slo.safety_margin)
    5. if available_rate < required_rate:
    6. return queue_or_reject(req, reason="throughput_pressure")
    7. # If VRAM is insufficient, prioritize evicting cold session caches rather than rejecting new requests
    8. if gpu_pool.free_kv_memory() < estimate_kv_need(req):
    9. victim = cache_store.evict_cold_session(policy="lru_ttl")
    10. if victim is None:
    11. return queue_or_reject(req, reason="kv_memory_pressure")
    12. return schedule_with_continuous_batching(req)

    This logic emphasizes that peak capacity is not a single switch but a dynamic decision constrained by throughput, VRAM, queuing, and SLA.

    3. Elastic KV Cache Design: Evictable, Reloadable, and Recomputable

    In most conversational workloads, KV cache is a performance acceleration structure, not immutable business state. Conversation history, user input, and model output are the business data requiring persistence. KV cache merely caches the intermediate results of historical context computation for quick reuse in subsequent turns. Therefore, under capacity constraints, the system can evict KV caches of cold sessions to free up VRAM for active sessions. When a user initiates the same session again, the system loads history from persistent storage to rebuild the cache, or recomputes directly based on the full conversation history.

    This design is feasible because chatbot workloads exhibit distinct “one-time” and “low-reuse” characteristics. Many requests are short sessions, single-turn Q&A, or temporary inquiries, with a low probability of users frequently returning to the same long session. Even with long multi-turn dialogues, users may not iterate at high frequencies in short timeframes. Thus, cache eviction policies can be aggressive: set TTLs for long-unused sessions, use LRU eviction for low-priority sessions, and prioritize releasing VRAM for recomputable sessions. The tradeoff is a potential increase in first-token latency upon re-entry, but this buys higher peak concurrent capacity.

    Engineering-wise, caching can be divided into three tiers: hot KV cache in GPU VRAM, warm cache in host memory, and cold history in object storage or local SSD. The hot tier targets low latency, the warm tier enables quick recovery, and the cold tier provides long-term conversation record storage. Eviction doesn’t necessarily delete business data; it only releases acceleration structures. Reloads follow a fallback order: “VRAM hit -> Memory hit -> Storage load -> Recompute”. For ultra-long contexts, recomputation is costly; differentiated strategies based on session value, user tier, and SLA should be applied rather than a one-size-fits-all approach.

    4. Capacity Planning: Turning Access Rollouts into Measurable Admission Control

    The first step in capacity planning is establishing a load profile: average input length, output length, session round distribution, peak periods, burst ratios, long-tail request proportions, cache hit rates, and recompute rates. The second step is stress testing to determine effective token throughput, first-token latency percentiles, and VRAM levels under different batching strategies. The third step is defining SLA tiers, applying different priorities and queue policies for interactive Q&A, long-text generation, and batch tasks. The fourth step is formulating the rollout pace: gradually releasing capacity through small-traffic gray releases, reservations, quotas, or time-based increments, while retaining the ability to quickly roll back.

    For infrastructure, tiered capabilities can be built using general GPU computing, object storage, and logging/monitoring services, such as those provided by Baidu AI Cloud; specific specs, quotas, and performance should be based on official documentation and stress test results. The key is not merely stacking resources, but creating a closed loop across compute, cache, storage, and observability: the GPU pool handles token throughput, the cache layer reduces recompute costs, the storage layer persists session history, and monitoring alerts preemptively detect capacity anomalies.

    Degradation strategies should also be designed in advance. Under throughput stress, you can limit maximum output length per request, shorten the carried historical context, lower the priority of non-real-time tasks, or move some requests to a queue with estimated wait times. For member access rollout, an admission model of “capacity threshold + gray release ratio” can be used: automatically tighten new admissions when GPU throughput, VRAM levels, queue times, or recompute rates exceed thresholds; gradually reopen as levels recover. This binds operational actions to technical metrics, avoiding heuristic scaling or sudden throttling.

    5. Monitoring and Postmortems: Focusing on Token Throughput, Cache Hits, and Recompute Costs

    Key metrics to monitor include: effective output tokens per second, first-token latency percentiles, per-token generation latency, queue time, active session count, VRAM levels, KV cache hit rates, cache eviction rates, storage reload counts, recompute counts and durations, and request failure/timeout rates. Long-tail metrics are also crucial: proportion of long-context requests, proportion of extra-long output requests, and burst traffic peaks and recovery times. During postmortems, answer three questions: Is the bottleneck in compute, VRAM bandwidth, cache capacity, or storage loading? Did the eviction policy accidentally drop high-value sessions? Does the access rollout pace match capacity levels?

    Conclusion

    In summary, compute strain in chatbot services is not simply “not enough GPUs,” but the result of the interplay between token throughput, VRAM capacity, caching strategies, scheduling efficiency, and admission control. By treating KV cache as an elastic resource that can be evicted, reloaded, and recomputed, treating user access rollouts as measurable, gradual, and reversible capacity governance actions, and combining this with continuous batching, tiered caching, throttling/degradation, and full-link monitoring, services can maintain user experience, cost efficiency, and stability during growth phases.