What happens when a hundred users hit your chatbot at the same moment and your GPU pods are still warming up? For most teams running large language models in production, that question turns into a fire drill: queues spike, time-to-first-token climbs, and someone starts manually spinning up replicas at 2 a.m. Autoscaling is supposed to prevent exactly this. Yet the standard playbook, built for web servers that scale on CPU, quietly falls apart when the workload is token generation on a GPU.
This article walks through how LLM inference autoscaling actually works, why the usual signals mislead, which metrics to watch instead, and where the sharp edges are in practice.
Why CPU-Based Autoscaling Fails for LLM Serving
The default Kubernetes autoscaler adjusts replica counts based on observed metrics. The Horizontal Pod Autoscaler (HPA) watches CPU, memory, or custom metrics through the metrics API and adds or removes pods accordingly. The `autoscaling/v2` API, which added custom and external metrics, reached general availability in Kubernetes 1.23 in December 2021. That history matters because it explains the mental model baked into most tutorials: load goes up, CPU goes up, add pods. (Kubernetes Deployments)
LLM inference breaks that chain. A GPU serving a model can sit at 100 percent utilization while handling one long request, or at 100 percent while handling forty short ones. CPU usage barely moves either way. The real bottlenecks are GPU memory, KV-cache occupancy, and batch composition. Autoscaling on CPU means you either never scale (CPU stays low) or scale for the wrong reason (a tokenizer thread gets busy while the GPU idles).
There is a second, subtler trap. Even if you scale on GPU utilization, that number is often pinned near saturation by design. Inference engines deliberately batch requests to maximize throughput, so a healthy deployment looks “full” almost all the time. A utilization-based trigger will keep adding replicas until you run out of quota, then wonder why latency never improved. (How to measure inference latency end to end)
The Metrics That Actually Drive Good Scaling Decisions

Because there is no single industry standard for LLM autoscaling signals, different stacks recommend different metrics. That is an evolving practice, not a settled one. Still, a handful of signals show up again and again because they map to what users feel.
| Metric | What it tells you | Scaling behavior |
|---|---|---|
| Queue depth / pending requests | How much work is waiting for a slot | Scale out when the queue grows past a threshold |
| Time to first token (TTFT) | How long users wait before output starts | Scale out when TTFT breaches an SLO |
| KV-cache utilization | How close you are to the memory ceiling | Scale out before cache eviction forces preemption |
| Tokens per second per replica | Throughput health of each pod | Useful for capacity planning, weak as a trigger |
| GPU utilization | Raw compute busyness | Usually saturated; poor trigger on its own |
| Requests per replica | Coarse load indicator | Works only for uniform request lengths |
The practical takeaway: queue depth and TTFT are the two signals most teams end up trusting, with KV-cache utilization as an early warning. Queue depth reacts before users notice anything. TTFT reacts exactly when they do. Everything else is context.
One caveat worth stating plainly: request lengths vary wildly. A batch of 50-token summaries and a batch of 4,000-token document analyses produce very different GPU time. Any autoscaler tuned to request count alone will oscillate. Weight your metric by tokens, or accept that you are tuning for an average that rarely exists.
How the KV Cache Caps What Scaling Can Fix
Here is the constraint that separates LLM autoscaling from ordinary service scaling. Every concurrent request consumes KV-cache memory proportional to its sequence length. The cache stores attention keys and values so the model does not recompute them for each new token. That memory is finite, and when it runs out, the engine must either queue new requests or preempt existing ones.
The PagedAttention research behind vLLM, published at SOSP 2023, showed how managing this cache in paged blocks cuts memory waste dramatically. But it does not remove the ceiling. Maximum batch size is bounded by GPU memory, which means a single replica can only serve so many concurrent sequences no matter how fast the hardware is. When you hit that wall, more batching will not help. You need more replicas.
This is why capacity planning for inference starts with memory, not compute. If you want to understand the arithmetic behind replica sizing, the explanation of why memory capacity matters for inference planning is a useful companion to this section. Teams that skip this step tend to over-provision GPUs and still miss latency targets, because they scaled the wrong resource.
Building an Autoscaling Stack That Fits LLM Workloads
A workable setup usually layers three things: a metrics pipeline, a scaling controller, and a serving layer that exposes the right signals.
Step 1: Expose inference-specific metrics
Most engines publish Prometheus-style metrics out of the box. Check for queue length, cache usage, TTFT histograms, and running-versus-waiting request counts. If your engine does not expose them, add a small sidecar or adapter rather than guessing from system metrics.
Step 2: Choose a controller that understands your trigger
The HPA can scale on custom metrics, which is enough for many teams. For bursty or queue-driven workloads, KEDA extends the HPA with event- and queue-based scalers, including scale-to-zero. KEDA joined CNCF in 2020 and graduated in August 2023, so it is a mature option rather than an experiment.
Step 3: Pick a serving layer with autoscaling built in
KServe, a Kubernetes-native model-serving layer that became a CNCF incubating project in 2022, wires autoscaling through Knative and the HPA, including scale-to-zero via Knative Serving. Ray Serve documents autoscaling for model deployments driven by request queue length and other metrics. NVIDIA Triton Inference Server supports HPA-based autoscaling using custom metrics scraped from its metrics endpoint.
Step 4: Set sane floors and ceilings
Minimum replicas protect latency during sudden spikes. Maximum replicas protect your budget. Most teams discover the ceiling should be set by GPU quota and cost, not by hope.
Scale-to-Zero: Great for Cost, Risky for Latency
Scale-to-zero is the most tempting lever in the whole system, and the one that bites hardest. Loading a large model into GPU memory can take tens of seconds to minutes. During that window, requests either fail, queue, or hit a cold-start penalty that dwarfs any savings.
The rule of thumb that holds up in practice: scale-to-zero suits low-traffic endpoints, internal tools, batch jobs, and development environments. It does not suit latency-sensitive chat or anything with an uptime commitment. If you must use it, keep a warm floor of one replica and accept that you have not really scaled to zero.
This is also where the batch-versus-real-time decision shapes your architecture. A comparison of batch and real-time inference tradeoffs helps clarify which endpoints can tolerate cold starts and which cannot. Batch pipelines can wait; a user staring at a blinking cursor cannot. (AI inference architecture: A practical enterprise guide)
Common Mistakes Teams Make
A few failure patterns show up so often they are worth naming.
Scaling on the wrong metric. CPU-based autoscaling for GPU workloads is the classic. It either never fires or fires for noise.
Ignoring request length variance. Averages hide the tail. One 8,000-token request can occupy a replica long enough to trigger a scale-out that arrives after the damage is done.
Setting thresholds too tight. Aggressive scale-out thresholds cause flapping: pods spin up, load drops, pods spin down, load spikes again. Add stabilization windows and cooldowns.
Forgetting the router. Scaling replicas is only half the job. Without a load-aware router, new pods sit idle while one replica absorbs everything. Routing by queue depth or cache usage matters as much as the replica count.
Measuring the wrong latency. End-to-end latency includes queueing, prefill, and token generation. If you measure only total request time, you cannot tell whether admission control or generation is the bottleneck. A guide to measuring inference latency end to end covers where the clock should start and stop.
Skipping load tests with realistic prompts. Synthetic short prompts produce beautiful autoscaling behavior that collapses under real traffic.
A Practical Tuning Checklist
When you sit down to configure this, work through the following in order.
- Instrument queue depth, TTFT, and KV-cache utilization per replica.
- Set an SLO for TTFT, then derive the queue-depth threshold that keeps you under it.
- Configure the HPA or KEDA with a stabilization window of at least a few minutes.
- Set minimum replicas to cover your p95 burst, not your average.
- Add a load-aware router so new capacity gets traffic immediately.
- Load test with prompt distributions pulled from production logs.
- Review thresholds monthly; traffic mix drifts.
None of this is glamorous. It is also the difference between a deployment that hums and one that pages someone every night.
Where the Practice Is Heading
Autoscaling for LLMs is still young. There is no settled standard for which metric should trigger a scale event, and different serving stacks recommend different signals. That ambiguity is not a flaw in your setup; it reflects a field where the hardware bottleneck, the memory model, and the traffic patterns are all unusual. Teams that treat autoscaling as a metrics problem rather than a replica-count problem tend to land in a better place. For a broader structural view, this guide to AI inference architecture puts autoscaling in context with routing, caching, and batching decisions that interact with it. (Autoscaling)
Conclusion
LLM inference autoscaling is not a matter of pointing a CPU-based autoscaler at a GPU deployment and hoping. It is a discipline built on the right signals: queue depth, time to first token, and cache pressure. It depends on understanding that KV-cache memory, not compute, sets the ceiling on concurrency. And it rewards teams who tune thresholds against real traffic, keep a warm floor for latency-sensitive endpoints, and treat scale-to-zero as a cost tool for the workloads that can tolerate it.
Get those pieces right and the 2 a.m. fire drills mostly stop. The GPUs stay busy, the queue stays short, and users never notice the machinery underneath.
Frequently Asked Questions
Why can’t I just use CPU-based autoscaling for LLM inference?
CPU usage barely reflects what a GPU is doing during token generation. A replica can be fully saturated on the GPU while CPU sits low, or show CPU activity from tokenization while the GPU idles. Scaling on CPU either never triggers or triggers for the wrong reason. Inference-specific metrics like queue depth and time to first token give a far more accurate picture.
What is the single best metric to autoscale LLM inference on?
There is no universal answer, because no industry standard exists yet. In practice, queue depth is the most reliable trigger because it rises before users feel anything, and time to first token is the best guardrail because it tracks exactly what users experience. Many teams use queue depth to scale out and TTFT to validate that the scaling worked.
Does autoscaling fix high latency?
Only if latency comes from insufficient capacity. If one replica is slow because of long sequences, cache eviction, or an oversized batch, adding replicas helps somewhat but does not address the underlying cause. Diagnose first: separate queueing delay from prefill and token generation time, then decide whether you need more replicas or better tuning.
Is scale-to-zero safe for production LLM endpoints?
Usually not for latency-sensitive ones. Loading a large model into GPU memory can take tens of seconds to minutes, and requests arriving during that window either fail or wait. Scale-to-zero works well for internal tools, batch jobs, and low-traffic endpoints where a cold start is acceptable. For customer-facing chat, keep at least one warm replica.
How many replicas should I run at minimum?
Enough to absorb your p95 burst without breaching the TTFT target, not your average load. A common approach is to size the floor from historical peak traffic over a short window, then let the autoscaler handle everything above it. Setting the minimum too low saves money on paper and costs far more in missed latency targets.
What is KEDA and why do teams use it for inference?
KEDA is a CNCF project that extends the Kubernetes Horizontal Pod Autoscaler with event- and queue-based scalers, including scale-to-zero. It joined CNCF in 2020 and graduated in August 2023. Teams use it for bursty inference workloads because it can scale on queue length directly, rather than requiring you to convert queue depth into a custom metric the HPA understands natively.







