LLM Capacity Planning and Stability Guide for Holiday Traffic Spikes

    This article explains how to prepare large language model (LLM) services for extreme holiday traffic peaks. It covers defining measurable SLOs, using queueing-theory-based capacity planning, inference-side optimizations such as continuous batching and KV cache reuse, fast elastic scaling, layered degradation strategies, cost governance, and a practical two-week preparation checklist.

    1. Why Holidays Become Stress Tests for LLMs

    During long holidays, especially in the hours around Lunar New Year’s Eve, AI application request curves often show extreme spikes. Users shift from work scenarios to entertainment and social scenarios, interaction frequency rises, individual sessions become longer, and the proportion of multimodal inputs increases. For the system, this means three things happen at the same time: concurrent connections rise, context length grows, and output tokens increase. Together, these factors cause inference-side resource usage to grow nonlinearly.

    The industry has reached a broad consensus that the two weeks before a holiday are a dense release period, with new models, new features, and new entry points launching together. For technical teams, this is both a user-acquisition window and a risk window. What really determines the experience is not how many features are available on launch day, but whether the system can maintain stable first-token latency and acceptable overall latency when the peak arrives.

    2. Define the Metrics First: Do Not Summarize Everything as “Latency”

    LLM service performance cannot be measured by a single metric. At a minimum, it should be broken down into four:

    • Time to first token (TTFT): determines whether the service feels responsive;
    • Time per output token (TPOT): determines whether long answers make users impatient;
    • Throughput (tokens/s or QPS): determines capacity per unit of cost;
    • Failure rate and timeout rate: determine whether users are willing to come back.

    It is best to write goals in a verifiable form rather than “make it fast”:

    1. slo:
    2. ttft_p95_ms: 800
    3. tpot_p95_ms: 40
    4. availability: 99.9
    5. timeout_rate: "<0.5%"
    6. max_context: 32k

    With an SLO in place, capacity planning, load-testing criteria, and degradation strategies all have a basis.

    3. Capacity Planning: Replace Guesswork with Queueing Theory

    An inference service is essentially a queueing system. Request arrival rate λ, service duration S, and concurrency N approximately satisfy the relationship: N ≈ λ × S. When context becomes longer and output becomes longer, S increases and the required concurrency rises linearly. Meanwhile, GPU memory usage and the KV cache grow with concurrency and context length, and often become the bottleneck first.

    In practice, this is done in three steps:

    1. Estimate peak arrival rate: use historical concurrent users, per-user request frequency, and a holiday amplification factor (a 3–5x upper bound is recommended) to project it;
    2. Work backward to the required concurrency and instance count: use safe concurrency per instance as the baseline and leave a 30% margin;
    3. Check GPU memory and bandwidth: confirm that the KV cache, batching window, and network egress will not saturate before compute does.

    A simplified capacity estimation example:

    1. peak_qps = online_users * req_per_user * peak_factor
    2. required_concurrency = peak_qps * avg_latency_sec
    3. instances = ceil(required_concurrency / safe_concurrency_per_instance * 1.3)

    4. Inference-Side Optimization: Get Higher Throughput from the Same GPUs

    With compute capacity fixed, the main optimization opportunities come from four areas:

    • Continuous batching: combine requests arriving at different times into batches to significantly improve GPU utilization;
    • KV cache reuse: apply prefix caching to identical prefixes (system prompts, fixed templates, long documents) to reduce repeated prefill;
    • Quantization and sparsification: use low-bit weights and KV quantization within an acceptable accuracy range to reduce GPU memory and bandwidth pressure;
    • Speculative decoding and parallel decoding: use a small model or draft mechanism to reduce the average number of generation steps.

    One engineering caveat: larger batches improve throughput, but per-request latency gets worse. A “dual-queue” approach is therefore recommended: interactive requests go through a high-priority small-batch queue, while offline batch processing uses large batches, so long-running tasks do not degrade the online experience.

    5. Elastic Scaling: Scaling Must Be Faster Than Traffic Ramps Up

    Holiday traffic is characterized by steep rises and steep drops. If scaling depends on cold starts, it is often too late. The following combination can be used:

    • Prewarm pool: keep a small number of always-on instances and send periodic requests to keep caches and weights resident;
    • Metric selection: do not look only at CPU; combine queue length, in-flight requests, and TTFT percentiles;
    • Tiered scaling: scale inference instances first, then the gateway and rate-limiting layer, to avoid “the backend scaled up but the entry point is clogged”;
    • Scale-in protection: set cooldown windows and a minimum replica count to prevent repeated scaling caused by jitter.

    Pseudocode example:

    1. if p95_ttft > SLO or queue_len > threshold:
    2. scale_out(step=2, cooldown=60s)
    3. if utilization < 30% for 10min:
    4. scale_in(step=1, min_replicas=prewarm_pool)

    6. Stability Fallbacks: Degradation Is Part of the Design, Not a Failure

    During peak periods, you must assume that some dependency will fail. Layered degradation options can be prepared:

    1. Model degradation: switch to a smaller-parameter model or a distilled version when the primary model is unavailable;
    2. Length degradation: limit maximum output and context to prioritize responding;
    3. Feature degradation: disable non-core multimodal and tool-calling features while keeping text-only Q&A;
    4. Static fallback: return cached answers or templated prompts to guarantee “there is a response.”

    At the same time, configure circuit breakers, retry budgets, and idempotency keys to avoid retry storms amplifying failures.

    7. Cost Governance: Spend Every Unit of Compute on Effective Tokens

    The most common waste during holidays is “long context + long output + repeated prefixes.” Governance measures include context trimming and summarization, prompt template reuse, output-length tiers, cache hit-rate monitoring, and quotas and priorities by business line. It is recommended to build a unit-cost dashboard: cost per thousand sessions, cost per ten thousand tokens, cache hit rate, and average output length, and use data to drive tuning.

    8. Two-Week Preparation Checklist (Ready to Execute)

    • Days 1–3: define the SLO, map the call chain and dependencies, and fill in monitoring and logging fields;
    • Days 4–7: run full-link load tests covering 1.5x peak and long-context scenarios;
    • Days 8–10: enable elastic scaling and the prewarm pool, and rehearse scaling speed;
    • Days 11–12: roll out new features gradually and verify degradation switches;
    • Days 13–14: freeze the release, set up on-call schedules, and put emergency plans and rollback scripts in place.

    9. Conclusion

    A holiday traffic spike is not a matter of luck, but an engineering problem that can be calculated and rehearsed. By defining metrics clearly, calculating capacity properly, maximizing inference throughput, and making elasticity and degradation routine capabilities, together with support from Baidu AI Cloud in general capabilities such as container platforms, log services, monitoring and alerting, and object storage, teams can achieve both visibility and stability during a dense release period.