High Availability Architecture for Large Language Models Under Extreme Traffic Spikes
This article presents a reusable engineering methodology for keeping large language model (LLM) services available during massive, short-lived traffic surges driven by marketing campaigns. It covers translating business peaks into measurable technical metrics, a layered architecture (access, cache, inference, and asynchronous processing), the four pillars of stability (rate limiting, degradation, circuit breaking, and isolation), observability signals, cost-versus-experience trade-offs, and a post-event review checklist. Readers will learn how to design systems that survive high-concurrency AI入口 traffic while preserving inference quality.
1. Abstracting the Phenomenon: A Traffic Battle Without a Main Character
During the recent holiday season, the industry saw intense competition around large language model entry points. One cloud vendor’s general-purpose assistant product reportedly committed marketing resources on the order of billions, sponsored multiple televised galas, and reached hundreds of millions of users through interactive campaigns, with the system briefly overloading and order flows being throttled at peak. Another platform’s assistant reportedly committed a red-packet budget on the order of a billion, attempting to replicate a viral growth path from more than a decade ago. Meanwhile, a widely anticipated new release of an open-source model was repeatedly rumored to move from free to paid installation, but ultimately did not ship during the holiday.
Once brand and marketing details are stripped away, the question worth studying is a general one: when marketing pushes hundreds of millions of users toward a single AI entry point within a few hours, how does the system survive while maintaining usable inference quality? This article does not recount any product experience. Instead, it abstracts the phenomenon into a reusable engineering methodology.
2. Translating Business Peaks into Technical Metrics
Traffic narratives must be grounded in metrics, otherwise capacity planning is guesswork. Start by converting business goals into four measurable constraints:
- Entry-point request rate (QPS) and peak unique visitors, distinguishing read-heavy query traffic from stateful claim-type traffic;
- The token-size distribution per request (input length and output length), which directly determines GPU memory usage and inference latency;
- Latency targets, typically P95/P99 rather than averages, because user perception is driven by the long tail;
- Cost ceilings, meaning the compute budget amortizable per request.
A simplified capacity estimation example (illustrating the method only, not any real product data):
# Peak concurrency = peak QPS × average response time (seconds)peak_qps = 80_000avg_latency_s = 2.5concurrency = peak_qps * avg_latency_s # hundreds of thousands of in-flight requests# Concurrency a single GPU can handle (determined by memory and batching strategy; calibrate via load testing)per_replica_concurrency = 64replicas = math.ceil(concurrency / per_replica_concurrency)
The key point: the bottleneck in LLM inference is usually not CPU but GPU memory and batching efficiency. Therefore, the scaling unit should be “inference replica + GPU memory quota,” not the “instance count” of traditional web services.
3. Layered Architecture: Breaking the Peak into Digestible Streams
3.1 Access Layer: Shape the Peak Before Adding Compute
The access layer handles rate limiting, authentication, canary releases, and protocol conversion. Use a token bucket for entry-point shaping, and apply fair queuing per user to prevent a single hot account from consuming all concurrency. Set independent rate-limit thresholds for non-core marketing interaction endpoints, isolating them from the core Q&A path.
3.2 Cache Layer: Multi-Level Hits Are the First Cost Lever
A common mistake in LLM scenarios is caching only final answers. A more effective approach is three-level caching:
- Semantic cache: match high-frequency phrasings via vector nearest-neighbor lookup and return directly on a hit;
- Fragment cache: reuse document fragments and system prompts in retrieval-augmented generation to reduce repeated encoding;
- Result cache: cache final outputs for structured tasks (such as copy templates or campaign-rule Q&A) with a reasonable TTL.
3.3 Inference Layer: Elasticity and Batching Together
Inference services should support dynamic batching and priority queues, downgrading low-value marketing requests to smaller models or template replies while reserving high-spec replicas for the core path. Replica scaling should be based on two metrics—“in-flight requests + queue wait time”—rather than CPU alone, otherwise scaling lags behind demand.
3.4 Asynchronous Layer: Trading Message Queues for Determinism
Write operations such as claiming, awarding, and ordering should be made asynchronous through message queues. The frontend only guarantees “accepted,” and the backend consumes idempotently by deduplication key. This converts an instantaneous write spike into a controllable consumption rate and naturally provides retry and dead-letter fallback.
4. The Four Pillars of Stability: Rate Limiting, Degradation, Circuit Breaking, Isolation
- Rate limiting: set limits at three layers—entry, model, and tool invocation—converging layer by layer;
- Degradation: preset a three-tier degradation chain of “template reply → small model → static fallback copy” to guarantee a response at all times;
- Circuit breaking: set failure-rate thresholds for downstream retrieval and third-party data interfaces to prevent slow calls from exhausting threads and connection pools;
- Isolation: use independent resource pools and quotas for the marketing path and the core path, preventing a single campaign failure from spreading into a site-wide outage.
Degradation switches must be hot-updatable through a configuration center rather than hard-coded, a point repeatedly validated during holiday on-call scenarios.
5. Observability: No Measurement, No Capacity
Collect at least three categories of signals: business-side (success rate, claim completion rate), service-side (P99 latency, queue backlog, replica count), and resource-side (GPU memory usage, batch size, cache hit rate). Treat “cache hit rate” and “degradation trigger count” as first-level alert metrics, because they are often precursors to an avalanche. Log services and monitoring alerts should share the same trace, making it possible to pinpoint within minutes whether the cause is an overly long prompt, a retrieval timeout, or insufficient replicas.
6. Balancing Cost and Experience
Elastic scaling brings cost volatility. A pragmatic approach: reserve a small amount of always-on capacity for predictable marketing peaks to eliminate cold starts, and handle the rest with elastic instances; set input-length limits and summarization preprocessing for long-text requests; route low-value requests to lightweight models. Object storage carries static assets, container platforms carry stateless inference gateways, and message queues handle peak shaving. Combining these general cloud product categories satisfies the vast majority of peak scenarios without relying on any proprietary interface.
7. Post-Event Review Checklist
After the event, answer five questions: how far the peak QPS deviated from the estimate, how much compute the cache hit rate saved, how many times degradation was triggered and whether it affected the core experience, how long scaling took from trigger to readiness, and whether the per-request cost fell within budget. Capturing these five items as input parameters for the next major campaign turns capacity planning from an art into engineering.
Traffic spikes themselves are not frightening; what is frightening is treating them as a marketing problem rather than an architecture problem. Translate peaks into metrics, break the path into streams, and make fallbacks configurable—then stability becomes something you can design.
