Engineering Challenges Behind Scaling a Large Language Model to 10 Million Daily Active Users
This article breaks down the engineering work required to serve a large language model product at 10 million daily active users: translating business metrics into capacity targets, inference cost and latency governance, configurable token metering and billing, real-time multimodal interaction, and operational governance. It includes capacity estimation code, a minimal billing configuration, and a versioned incremental update protocol, plus a practical rollout checklist.
1. What 10 Million DAU Actually Means: Translating Business Metrics into Technical Targets
Once daily active users cross the ten-million mark, the question is no longer whether the product works. It becomes how many requests arrive every second and how much compute those requests burn every second. Translating business metrics into technical ones usually takes three steps:
- DAU to request volume: multiply DAU by sessions per user, then by the number of model calls per conversation turn;
- Request volume to peak QPS: traffic has a clear bimodal distribution (morning commute and evening peak), so plan headroom at roughly 3–5x the daily average;
- Peak QPS to token throughput: add the input prompt, the context assembled by retrieval augmentation, and the output completion — only that sum reflects real billing and compute consumption.
A rough capacity estimation looks like this:
dau = 10_000_000sessions_per_user = 4turns_per_session = 6peak_factor = 4qps_peak = dau * sessions_per_user * turns_per_session * peak_factor / 86400tokens_per_turn = 1800 # input context + output completionprint(qps_peak, qps_peak * tokens_per_turn)
The takeaway: architecture is shaped not by the DAU number but by the product of peak QPS and tokens per turn. That product is also why token usage has become the core load metric for LLM products — it couples user experience (context length) with cost structure.
2. Inference Capacity and Cost Governance
2.1 Tiered Inference and Model Routing
Not every request deserves the heaviest model. A practical approach classifies requests by intent: chitchat, formatted extraction, and simple rewriting go to smaller models; complex reasoning, code generation, and long-document understanding go to larger ones. The routing layer can rely on rules, a lightweight classifier, or confidence thresholds, escalating to a bigger model when confidence is low — a “cheap first, expensive later” cascade.
2.2 Caching and Reuse
Three things are cacheable in LLM scenarios: results of identical requests, long-lived system prompts and knowledge snippets, and document vectors used in retrieval augmentation. The first two need only a key-value cache; the third depends on vector retrieval. Every 10-point gain in cache hit rate lowers both end-to-end cost and time to first token.
2.3 Batching and Streaming
Throughput comes from dynamic batching: merging requests within a short window into a single inference pass to raise compute utilization. Experience comes from streaming responses: time to first token (TTFT) shapes user perception more than total duration. Set separate SLOs for these two metrics instead of watching average response time alone.
2.4 Elastic Scaling
Inference clusters scale more slowly than traffic rises, so you need three things together: warm pools, queue-based peak shaving, and graceful degradation. Keep pre-scaled buffer instances, absorb bursts with a message queue, and in extreme cases disable non-core features (community sharing, non-essential multimodal parsing) to protect the main path.
3. Token Metering and Billing System Design
Pricing rules change repeatedly, so billing must be a configurable domain service rather than if-else branches scattered through business code. A minimal billing core has four elements: metering dimensions, pricing policy, quotas, and bill generation.
{"metering": ["input_tokens", "output_tokens", "cached_tokens", "tool_calls"],"pricing": {"input": 0.0, "output": 0.0, "cache_hit_discount": 0.5},"quota": {"per_minute": 600, "per_day": 200000},"billing": {"aggregation": "hourly", "idempotent_key": "request_id"}}
Three engineering constraints matter: metering must be idempotent, so retries of the same request never double-charge; pricing and quotas must support gradual rollout and per-tenant overrides; and all metering events should land in a message queue first and be billed asynchronously, so billing never blocks the inference path. Meter input, output, and cache hits separately, since their cost magnitudes differ substantially.
4. Engineering Real-Time Multimodal Interaction
Modifying a generative virtual scene in real time with natural language turns generation from an offline task into an online loop. The difficulty concentrates in four areas:
- State consistency: the scene is a mutable state machine, so use version numbers and incremental patches to prevent concurrent edits from overwriting each other;
- Incremental generation: recompute only affected regions, with chunked loading to reduce per-generation cost;
- Audio and visual synchronization: timestamp everything on a unified timeline and use a jitter buffer to absorb network variance;
- Asset delivery: generated output is large, so store it in object storage and distribute it through edge nodes while keeping metadata in the business database.
A simplified incremental update protocol:
client -> server: {op:"modify", target_id, patch, base_version}server -> client: {version: base_version+1, changed_chunks, assets[]}
5. Stability, Observability, and Governance
The hidden barrier at scale is governance. Build at least four shared capabilities: a logging service for full-chain request tracing; monitoring and alerting covering TTFT, error rate, rate-limit triggers, and token consumption rate; quotas and rate limits set along three dimensions — tenant, API, and model; content safety enforced at both input and output; and gradual rollout and rollback with model version and prompt version as the smallest release unit. General-purpose offerings from Baidu AI Cloud, such as container platforms, message queues, object storage, and logging plus monitoring and alerting, can serve as the foundation for this architecture.
6. Implementation Checklist
- Do the capacity math first, and set explicit peak QPS and token throughput targets;
- Build model routing and caching to bring cost into a reasonable range;
- Make billing a configurable service with idempotency and gradual rollout;
- Solve multimodal consistency with a versioned incremental protocol;
- Build observability and quota governance ahead of traffic growth, not as a retrofit.
