Back to the Denominator: Rethinking LLM Inference Capacity Governance

    This article examines a real-world incident where an LLM inference service imposed session limits during compute shortages, followed by a large infrastructure budget approval. It argues that capacity issues are not solved by funding alone, and introduces the concept of "going back to the denominator"—breaking down unit request cost, cache efficiency, idle resource usage, and cold-session overhead. The article provides technical methods for capacity planning, long-session governance, graceful degradation, and cost-aware scaling, along with observable metrics and a practical implementation checklist for sustainable LLM inference operations.

    Introduction: Quotas as a Signal, Not a Destination

    A large language model inference service once handled compute shortages by imposing limits on long-running sessions. Later, it secured large-scale infrastructure funding. It is tempting to read this sequence as “money arrives, capacity problems are solved.” But from an engineering perspective, a quota is simply a signal that demand has exceeded capacity. Capital investment increases the “numerator”—available resources. What truly determines service sustainability is the “denominator”: how many resources a single request consumes, how much cache can be reused, how many idle resources exist, how long requests wait in queue, and how much storage and scheduling overhead long-session states occupy.

    This article abstracts that event into a general technical discussion on LLM inference capacity governance and unit-cost post-mortem analysis.

    Abstracting the Event: Quota Is a Capacity Indicator, Not a Product Limitation

    Resource consumption in an inference service is not determined by request count alone. The cost of a single request is driven by input length, output length, concurrency, context window size, session state retention time, batching efficiency, and model scale and quantization strategy.

    Long sessions are particularly tricky. A session may be inactive for a long time but still occupy cache, metadata, GPU memory, or external state storage. When active and cold sessions are mixed, the scheduler must make trade-offs in finite resources.

    Therefore, setting limits on inactive long sessions, shortening idle time-to-live, or restricting very long contexts is not necessarily a product capability gap. It is often a capacity governance mechanism to protect system stability. The key question is not “whether to set a limit,” but whether the limit policy is based on observable evidence, can be adjusted dynamically, can distinguish high-value requests from ordinary ones, and can offload cold sessions to lower-cost storage with a smooth recovery path.

    The Technical Meaning of “Going Back to the Denominator”

    “Going back to the denominator” means: before adding capital investment, first clarify the unit economic model. Common denominators include effective request count, processed token count, active session count, GPU hours, and storage GB-hours. Numerators include compute cost, storage cost, network cost, operational cost, and idle cost. A simplified unit-cost model can be written as:

    1. per-request cost ≈ (input tokens × unit compute factor + output tokens × unit compute factor
    2. + session state storage cost + scheduling and queueing cost) / cache hit rate

    Capacity planning can also be abstracted as:

    1. required capacity ≈ peak demand percentile × per-request resource consumption × safety factor / target resource utilization

    If the target utilization is too low, scaling up leads to substantial idle cost. If the safety factor is too high, resources are wasted. Therefore, going back to the denominator does not mean refusing to scale. It means answering three questions before expanding: Is the current bottleneck compute, memory, storage, or scheduling? What is the dominant component of per-request cost? Which metrics will improve after expansion, and how long will it take to recover the investment?

    Capacity Planning: From Demand Percentiles to Resource Quotas

    Capacity planning should not rely on averages. It must examine peak percentiles and tail behavior. We recommend establishing layered metrics: track concurrency, input/output length distribution, queue latency P99, cache hit rate, session recovery rate, and resource fragmentation—broken down by model, API, tenant, and request type. For long sessions, separately track idle time distribution and recovery frequency to avoid mistaking “cold session occupancy” for “continuous compute demand.”

    A practical configuration example is as follows:

    1. service:
    2. session:
    3. idle_ttl_minutes: 30
    4. max_context_tokens: 32768
    5. summarize_threshold_ratio: 0.75
    6. cold_state_storage: object_store
    7. quota:
    8. max_concurrent_requests: 200
    9. queue_timeout_ms: 3000
    10. per_tenant_burst_ratio: 1.5
    11. autoscale:
    12. target_gpu_utilization: 0.65
    13. queue_latency_p99_ms: 1500
    14. scale_out_cooldown_seconds: 120

    The core ideas are: control cold session occupancy with idle TTL, control per-request resource ceiling with context compression, control overload with queue timeout and tenant burst ratio, and trigger autoscaling based on a combination of utilization and queue latency. Parameters should not be arbitrary; they need to be calibrated through load testing and online percentile regression.

    Long-Session Governance: TTL, Summarization, and Tiered State

    Long-session governance can be approached in four layers. The first is lifecycle management: set an idle TTL for sessions, migrate session state from the hot path to low-cost storage after timeout, and restore on-demand when the user returns. The second is context compression: when the context approaches the window threshold, summarize earlier content, extract key facts, or keep structured memory to reduce repeated transmission and computation. The third is cache reuse: cache stable prefixes like system prompts, common knowledge snippets, and tool descriptions to improve hit rate. The fourth is tiered service: use different queues and timeout policies for real-time interaction, batch processing, and low-priority analytical tasks.

    It is important to note that session offloading is not simply deletion. You must track recovery cost, summarization error, and user-experience impact. If cold sessions are recovered too frequently, the TTL may be too short or the user behavior model is inaccurate. If answer quality degrades after summarization, the compression strategy is too aggressive. The governance goal is not “to minimize savings at all costs,” but to find an explainable balance among cost, latency, and quality.

    Elasticity and Graceful Degradation: Deterministic Behavior Under Load

    The most dangerous scenario during overload is not queuing, but the absence of a deterministic degradation strategy. We recommend preparing multi-level degradation measures: limit the maximum context per request, extend queueing time for non-real-time tasks, route some requests to smaller models, enable result caching, pause low-priority batch processing, and require cold sessions to rebuild lightweight context. Degradation policies should be tied to service priority levels and logged with monitoring and alerting systems, so failures are not silent.

    Autoscaling should not rely only on GPU utilization. Better composite indicators include queue latency P99, GPU memory level, cache hit rate, cold-session recovery queue length, and tenant quota usage. Scale-out should have a cooldown period to prevent flapping; scale-in should retain a safety margin to avoid interrupting long-tail requests.

    Funding and Scaling Decisions: Denominator First, Then Numerator

    Large-scale infrastructure funding can expand compute, storage, and network resources, but it does not automatically improve unit efficiency. A more reliable decision sequence is: first improve the denominator, then expand the numerator. This includes: cleaning up long-lived low-hit caches, compressing oversized contexts, improving batching efficiency, applying per-tenant quotas, migrating cold state to object storage, using a message queue to smooth traffic peaks, and building a cost-allocation dashboard. Only after these steps should expansion be used to address genuine incremental demand.

    After funding is secured, establish a closed loop of “budget → capacity → performance → cost.” Each expansion should correspond to expected throughput gains, P99 improvements, and unit-cost changes. Review resource idle rate, fragmentation, and payback period monthly. If the per-request cost goes up after expansion, inspect scheduling fragmentation, over-provisioning, and cold-session recovery spikes.

    Observability and an Actionable Checklist

    At minimum, monitor: cost per thousand tokens, cost per active session, GPU utilization, GPU memory level, cache hit rate, cold-session recovery rate, queueing P99, timeout rate, degradation trigger count, tenant quota hit rate, and resource fragmentation. An implementation checklist can be divided into short, medium, and long term:

    • Short term: session TTL, context limit, queue timeout, and basic dashboards
    • Medium term: summarization compression, prefix caching, tiered queues, and autoscaling
    • Long term: unit economics model, capacity prediction, and budget-linked mechanisms

    In a Baidu AI Cloud environment, the above concepts can map to general-purpose compute, object storage, cache, message queue, logging, and monitoring categories. Implementation should favor standard interfaces and replaceable components, avoiding lock-in to single proprietary APIs.

    Ultimately, compute quotas are a signal, capital is a means, and going back to the denominator is the engineering method that makes inference services sustainable in the long run.