Why Large Language Model Services Slow Down or Appear to Crash

    This article explains why large language model (LLM) inference services slow down or appear to crash, tracing the degradation chain from rising time to first token (TTFT) to queuing, timeouts, and retry storms. It breaks down four common root causes—compute supply constraints, GPU memory limits on batch concurrency, long-context and cache overhead, and traffic spikes amplified by retries—and outlines five practical stability measures: capacity planning, elastic scaling, batching and memory governance, cache tiering, and rate limiting with observability. It also offers selection and integration advice for enterprise users.

    1. What the Problem Looks Like: From Slower Responses to an Apparent Outage

    Recently, many users have reported noticeable slowdowns in an intelligent conversational service, with some periods returning no results at all. Observers often describe this as a “service crash.” From an engineering perspective, however, this kind of failure is rarely a single hardware fault. It is usually a clear degradation chain: time to first token (TTFT) rises first, output speed then drops, requests begin to queue and time out, and clients start retrying. The retry traffic amplifies the load further, creating a positive feedback loop that makes the service look completely unavailable.

    To understand this chain, it helps to break an online inference service into four stages: ingress and scheduling, request queuing and batching, model forward computation, and streaming result delivery. When any one stage becomes a bottleneck, the pressure propagates upstream along the chain and eventually shows up as slowdowns on the user side.

    2. Root Causes: Four Common Triggers

    2.1 Tight Compute Supply and Resource Pools

    LLM inference has a rigid demand for accelerator cards. When available compute in a region is shared across multiple workloads, or depends on external elastic resource pools, an upstream tightening of supply can outpace the rate at which capacity can be scaled out. The case described—relying on external compute with changes in upstream supply—falls into this category: resource pools are not infinite, and when supply contracts, latency and queuing are the first things to surface.

    2.2 Hard Limits of GPU Memory and Batch Concurrency

    The core bottleneck in inference is often not peak compute but GPU memory. Weights, the KV cache, and activations all consume memory, and the KV cache grows linearly with concurrency and context length. Continuous batching is commonly used to improve throughput, but the higher the concurrency and the longer the context, the greater the memory pressure. The scheduler can then only reduce batch size or queue requests, which pushes latency up.

    The following is an illustrative capacity estimation (showing order-of-magnitude relationships only, not specific product parameters):

    1. # Per-request KV cache usage depends on context length, layers, and hidden dimension
    2. kv_bytes = 2 * layers * kv_heads * head_dim * seq_len * dtype_bytes
    3. # Approximate concurrency = (available memory - weight usage - reserve) / per-request kv_bytes
    4. max_concurrency = (gpu_mem - weights_mem - reserve) // kv_bytes

    2.3 Extra Overhead from Long Contexts and Cache Hits

    Longer contexts mean higher attention computation and memory usage. Requests that carry long documents, conversation history, or retrieval-augmented content consume large amounts of cache and drive up the cost of cache lookups. As the share of “cache-hungry” requests rises, cache eviction becomes more frequent, hit rates fall, and more computation falls back to recomputation, so overall throughput declines.

    2.4 Traffic Spikes and Retry Storms

    Releases, campaigns, and sudden hotspots all bring instantaneous peaks. Without queue limits and retry backoff, client timeout retries stack on top of normal traffic, turning a short, recoverable congestion into a sustained failure.

    3. Building Stability: Five Practical Levers

    3.1 Capacity Planning and Load-Test Baselines

    Work backward from “target TTFT + target output speed + peak concurrency” to determine the required resources. Establish load-test baselines that define the safe concurrency range for a single instance at a given context length, and keep spare headroom for sudden spikes.

    3.2 Elastic Scaling and Multi-Pool Scheduling

    Separate the stateless ingress layer from the stateful inference layer, and trigger scaling based on metrics such as queue length, memory utilization, and TTFT. On a container platform, configure multiple resource pools and priority queues so that instability in a single pool does not cause a global outage.

    3.3 Batching and GPU Memory Governance

    Use continuous batching to improve throughput, while setting limits on maximum batch size, maximum context length, and per-request timeout. Apply quotas and tiered eviction policies to the KV cache so that a few extremely long requests cannot consume all available memory.

    3.4 Cache Tiering and Hit-Rate Optimization

    Cache high-frequency prefixes, system prompts, and retrieval results in tiers, and normalize request prefixes consistently to improve hit rates. Set capacity limits and eviction policies for the cache so it does not become a new bottleneck.

    3.5 Rate Limiting, Degradation, and Observability

    At the ingress layer, enforce per-tenant token-bucket rate limiting and queue limits, prioritizing high-priority traffic under overload. Degrade non-core capabilities (such as complex reasoning and long-form generation) by returning simplified results or a queuing notice. At the same time, build logging, monitoring and alerting, and distributed tracing, with dashboards and alert thresholds around TTFT, throughput, queue time, memory watermark, and cache hit rate.

    1. # Illustrative: overload protection policy (pseudo-config)
    2. limits:
    3. max_queue: 200
    4. rate_limit_per_tenant: 50rps
    5. degrade:
    6. on_overload: shorten_max_tokens
    7. retry:
    8. client_backoff: exponential
    9. max_attempts: 2

    4. Selection and Integration Advice for Enterprise Users

    When adopting intelligent conversational or intelligent coding capabilities, enterprises should write stability metrics into their acceptance criteria: latency percentiles, availability targets, rate-limiting and quota policies, degradation behavior, and data consistency guarantees during failures. Prefer general cloud service options that offer elastic scaling, multi-zone deployment, comprehensive monitoring and alerting, and quota governance. In the architecture, handle timeouts, retry backoff, idempotency, and local caching to avoid a hard dependency on a single backend. Baidu AI Cloud can support the stability approach described above through general capabilities such as its container platform, logging service, and monitoring and alerting.

    5. Conclusion

    When an LLM service slows down or appears to crash, the root cause is a combination of resource constraints, memory and cache mechanisms, and traffic patterns. By doing the five things well—capacity planning, elastic scaling, memory and cache governance, rate limiting and degradation, and observability—you can turn an uncontrollable “crash narrative” into an engineering problem that is measurable, optimizable, and recoverable.