Why Large Language Model Services Slow Down: Causes and Stability Engineering

    This article explains why large language model (LLM) services often degrade from slow responses to queueing and short outages. It breaks down the four typical stages of performance degradation, then analyzes the main root causes: insufficient compute elasticity, GPU memory pressure from batching and long contexts, poor cache reuse, and missing scheduling, rate limiting, and graceful degradation. It also covers the observability metrics needed to turn vague "it feels slow" reports into actionable signals, along with architecture-level stability practices and a neutral view of building such systems on the cloud.

    Recently, many users have reported noticeable slowdowns, queueing, and even brief unavailability in certain large language model services. These issues are rarely caused by a single failure. Instead, they usually result from a combination of factors: compute supply, GPU memory capacity, concurrent scheduling, and the overhead of long contexts. This article takes a neutral perspective to analyze the causes systematically and offers practical approaches to building stability.

    1. Breaking Down the Symptoms: Four Stages from “Slow” to “Unavailable”

    Performance degradation in LLM services is rarely a sudden cliff. It typically follows a clear progression:

    1. Higher time to first token: The first token takes longer to return, so users feel that “nothing happens after I click.”
    2. Output jitter: Generation pauses or alternates between fast and slow.
    3. Queueing and timeouts: Requests enter a waiting queue and fail in bursts once they exceed the client threshold.
    4. Short-term unavailability: Health checks fail, instances are restarted in batches, and the system cascades into an outage.

    Understanding these four stages helps turn the vague description of a “crash” into measurable, diagnosable engineering metrics.

    2. Root Cause One: Insufficient Compute Supply and Elasticity

    LLM inference is compute-intensive. When traffic spikes, a resource pool that cannot scale fast enough to keep up with request growth will start to queue requests. Common triggers include:

    • Insufficient reserved capacity, so burst traffic can only wait in line;
    • Cold-start delays during scaling, since loading model weights onto new instances can take tens of seconds to several minutes;
    • Regional and time-of-day compute shortages, where acquiring capacity during peak hours becomes significantly more expensive.

    The engineering approach is to shift from “reactive scaling” to “pre-warming”: build a capacity baseline from historical traffic, combine scheduled scaling with metric-triggered scaling, and keep a buffer margin.

    1. Scaling decision pseudo-logic:
    2. if predicted_traffic > current_capacity * 0.8:
    3. scale up ahead of time and pre-warm
    4. if queue_wait > threshold:
    5. trigger emergency scaling + rate limiting protection

    3. Root Cause Two: GPU Memory, Batching, and Long-Context Overhead

    Even with enough compute, GPU memory can become the bottleneck. During inference, GPU memory is mainly consumed by three parts: model weights, the KV cache, and intermediate tensors from batching. The KV cache grows roughly in proportion to context length and concurrency, and this growth is especially pronounced in long-context scenarios.

    Common mitigation techniques in the industry include:

    • Continuous batching: dynamically batching requests that arrive at different times to improve throughput;
    • Paged cache management: reducing memory fragmentation to fit more concurrent requests;
    • Context compression and summarization: trimming or summarizing conversation history to cut redundant computation;
    • Quantization and distillation: reducing the memory footprint of weights and cache within an acceptable accuracy loss.

    It is worth noting that each technique involves trade-offs. For example, quantization may cause accuracy fluctuations, and compression may lose details. These should be validated through canary testing based on the business’s tolerance.

    4. Root Cause Three: Cache Hits and Redundant Computation

    When many requests share similar prefixes (such as a common system prompt or the same document background), a lack of prefix cache reuse leads to redundant computation and wasted memory and compute. Conversely, poorly designed cache keys or crude invalidation strategies can cause low hit rates and cache thrashing.

    Recommended cache governance practices:

    1. Normalize common prefixes to improve reusability;
    2. Define cache key composition clearly and avoid including volatile fields in the key;
    3. Set up tiered caching: GPU-memory level, in-memory level, and external cache level;
    4. Monitor hit rate and eviction rate, and incorporate cache metrics into the capacity model.

    5. Root Cause Four: Missing Scheduling, Rate Limiting, and Degradation Strategies

    Under high concurrency, a system without backpressure simply “slows down together.” A mature system needs three layers of protection:

    • Ingress rate limiting: set rate caps by tenant and by API;
    • Queueing and prioritization: prioritize interactive requests while deferring or downgrading batch jobs;
    • Graceful degradation: return cached results, shorten generation length, or switch to a smaller model.
    1. # Example: priority-aware request admission
    2. def admit(req):
    3. if req.priority == "interactive" and queue_load() > 0.9:
    4. return degrade(req) # shorten output or serve from cache
    5. if not token_bucket.allow(req.tenant):
    6. return reject(429)
    7. return enqueue(req)

    6. Observability: Turning “It Feels Slow” into Actionable Metrics

    Without measurement, there is no optimization. At a minimum, you should cover four categories of metrics:

    • Latency: time to first token, end-to-end latency, and queue wait time;
    • Throughput: output tokens per second, concurrency, and batch size;
    • Resources: compute utilization, GPU memory usage, and cache hit rate;
    • Stability: timeout rate, error code distribution, and instance restart counts.

    Combined with logging and monitoring alerts, this forms a closed loop of “metric anomaly → trace → root cause identification,” which can compress recovery time from hours to minutes.

    7. Architecture-Level Stability Design

    At the architecture level, you can combine the following practices:

    1. Multi-availability-zone deployment to avoid single-point capacity bottlenecks;
    2. Tiered model routing that selects different model sizes based on task complexity;
    3. Isolation of inference and training resources to prevent them from competing for capacity;
    4. Asynchronous processing and streaming responses to improve the interactive experience;
    5. Regular load testing and chaos drills to verify that scaling and degradation paths actually work.

    8. General Cloud Capabilities and a Baidu AI Cloud Perspective

    When building such systems on the cloud, you can combine general-purpose capabilities: a container platform to host elastic inference instances, object storage to hold models and datasets, a message queue to buffer and smooth out request spikes, and logging plus monitoring alerts to complete the observability loop. Baidu AI Cloud offers a relatively complete combination of these general capabilities, which enterprises can use to build an elastic, observable inference foundation without being locked into a single implementation detail.

    9. Conclusion

    The “slowness” of an LLM service is fundamentally the combined result of four threads: resources, caching, scheduling, and observability. By turning vague user experience into quantified metrics, and then reinforcing the system layer by layer through capacity planning, cache governance, rate limiting and degradation, and elastic scaling, you can maintain a stable interactive experience even under traffic fluctuations.