KEDA on GPUs: Why It Doesn’t Scale Like CPUs (& What to Do About It)

Intro

Autoscaling on Kubernetes is never one trick, it’s a whole Swiss knife: HPA, VPA, cluster autoscalers/Karpenter, and for anything event-driven, KEDA. The latter is one of the most effective ways to help serving survive erratic bursts without babysitting replica counts. But the more time I spend on AI inference, the more one misconception keeps creeping: people think they can scale GPUs the way they scale CPUs, as if KEDA could make GPUs pop out of thin air like oversubscribed CPUs always do with threads. It can’t. It’s a world away, and the topic deserves way more noise.

Today we’ll unfold this misconception, picking up right where GPU Sharing: KAI vs HAMi vs MIG left off: from fitting more models on a GPU to scaling them, sliced or not.

KEDA Can’t Count Your GPUs

On CPU, scaling is a simple chain: KEDA feeds a metric to the HPA, the HPA asks for pods, the scheduler finds room. And it always finds room: a core splits into a thousand millicores, the kernel overcommits and throttles under pressure, and a pod that can’t fit now just fits seconds later. So simple that nobody ever looks at the last link.

One more pod: on a CPU node millicores and overcommit squeeze it in within seconds, on a GPU node whole cards are taken or not and the pod goes Pending

GPUs snap that chain. There is no GPU cgroup, so Kubernetes deals in whole cards: nvidia.com/gpu: 1 is the smallest unit it understands through the driver (DRA, GA since Kubernetes 1.34, is starting to change that, but that’s another post), and as we covered in GPU Sharing, an engine keeps its card until it dies. A new pod fits or it goes Pending, and on a busy GPU node the answer is frequently no.

This is why GPU scaling breaks every assumption CPU scaling folks have, all chips aren’t born the same:

Your CPU instinctGPU reality
Slice a core a thousand waysA whole card or nothing
The kernel always squeezes one more inA pod fits or it goes Pending
Busy means loadedBusy at 2 requests, busy at 200
Mistakes self-correct in secondsPending forever, KEDA still asking

How It Bites: Pending Forever

One node, 8 GPUs. One vLLM replica, one engine, one big model split pipeline-parallel across 7 GPUs, 1 card to spare. Traffic bursts, utilization spikes, and KEDA does exactly what you configured it to do: scale to 2 replicas.

The new pod wants 7 GPUs. The node has 1.

Pending, forever: KEDA stares at red-hot metrics and keeps demanding a replica that will never schedule. (Skip the GPU requests to pack VRAM and it “schedules”, OOMs, and crash-loops instead. Pick your poison.)

KEDA scales on hot GPU metrics and requests a second 7-GPU replica on a node with only one free GPU; the pod goes Pending then CrashLoopBackOff, and no feedback loop tells KEDA the scale-up failed

Technically every component did its job, but surprise: KEDA has no idea how many free GPUs you have. A pod stuck in Pending is invisible to it, so it never backs off, just keeps asking. Watching load is KEDA’s job, counting cards is the scheduler’s, and nobody wired the two together. So surely a scaler built for GPUs, one that lives right next to the silicon, would fix this? Glad you asked.

What is keda-gpu-scaler? A Promised Fix? Does It Stick?

Enter pmady/keda-gpu-scaler, our case study and the cleanest NVML → KEDA path out there. A DaemonSet on every GPU node reads NVML on demand and answers KEDA over gRPC, one short hop from silicon to HPA instead of the DCGM → Prometheus → KEDA relay. On paper this is the dream, a scaler that lives on the node, closer to the GPU than anything else in the stack.

REPO pmady/keda-gpu-scaler →

So, does it stick? Two receipts from its own docs say the slot blindness survives. Metrics are node-local. There is no mechanism to scope metrics to the GPUs a specific deployment owns: two unrelated workloads sharing a node read the exact same numbers, and the gpuIndex parameter still pins a GPU, not a workload. Worse: KEDA reaches the DaemonSet through a plain ClusterIP Service, so each query lands on whatever node kube-proxy picks. The README now says it plainly: one ScaledObject per node until cluster-wide aggregation exists.

Aggregation can’t save you either. Back to our node, 7 GPUs saturated, 1 idle: max reads 100%, avg reads 87.5%, min reads 0%, sum reads 700%, and the new p95 and p99 modes read 100% too. The docs recommend max for inference. So the blessed mode screams scale-up while exactly one free slot exists. No aggregation mode encodes free slots, because “free slots” is not a thing NVML measures.

Aggregation trap: a node with 7 GPUs at 100% and 1 idle reports max 100%, avg 87.5%, min 0%, sum 700%; the recommended modes say scale up and none encodes free slots

So no, it doesn’t really stick. The crash loop above plays out exactly the same with it installed, and not because the engineering is bad, it’s genuinely fast and clean. Living next to the GPU buys better metrics, not slot awareness, and the same blindness applies to any metric-driven GPU autoscaling, DCGM + Prometheus included.

The KEDA Double Trap, in vLLM

If the workload is an LLM engine, you get burned twice.

Trap 1

The signal lies

GPU utilization only measures how often at least one kernel was running. It can’t tell compute-bound from memory-bandwidth-bound, or one stream holding up the rest, and it certainly can’t tell you requests are piling up. vLLM’s continuous batching keeps kernels running nonstop, so the gauge sits near 100% whether the queue holds 2 requests or 200.

Trap 2

The timing compounds it

A big model takes 3 to 5 minutes to load, and the metric stays hot the whole time. And HPA doesn’t tiptoe: set a 30% target, let one pod read 100%, and it asks for 4 replicas in a single jump, not 2. The repo’s own benchmarks agree: cold start is pod startup, not metric latency.

Things to know: KEDA’s cooldownPeriod won’t save you here, it only guards scale-to-zero. Out of the box HPA has zero scale-up brakes: 4 pods or a doubling every 15 seconds. Add scaleUp behavior policies before traffic adds them for you.

Nobody Scales on Utilization Anymore

Don’t take my word for it. Every major serving stack has already standardized on demand signals, and not one of them scales on GPU utilization:

StackScaling signalThe brain (who decides)
llm-dEPP gateway queue size + running requests, via PrometheusKEDA’s Prometheus scaler creates and owns the HPA
KServevLLM waiting/running requests, KV cacheautoscalerClass: keda, direct ScaledObject pass-through (its WVA brain came and went)
NVIDIA DynamoTTFT/ITL targets, queue + KV thresholdsPlanner, purpose-built; HPA/KEDA demoted to optional plug-ins

Notice what’s stable and what isn’t. The brains keep churning: llm-d’s WVA optimizer retired at v0.9.0, KServe’s WVA integration is already deprecated, Dynamo benched generic autoscalers behind its Planner. The signals never churned once: gateway queues, engine queues, token targets. Three stacks, three different answers, one shared refusal: nobody picked the GPU gauge. llm-d even writes the reason into its docs: GPU utilization pins near 100% during batching.

Three stacks, three answers, one refusal: llm-d scales on the gateway queue, KServe passes engine metrics through KEDA, Dynamo built its Planner, and gpu_utilization is picked by nobody

And in fairness to the KEDA maintainers: a native GPU scaler inside KEDA core can’t really happen. NVML, the NVIDIA library that reads the GPU, is C code that has to run on each GPU node, while KEDA is a single pure-Go operator built without C support. That’s why GPU scalers live outside it as DaemonSets, the case the scaler’s own author makes in KEDA issue #7538. KEDA was never going to count your GPUs. Nothing will make it.

The Fix: Teach Your Stack to Count

The playbook isn’t exotic. What matters is the order: enforce first, then count, then grow, then fix the signal.

1 · Enforce

Let the scheduler enforce

Set real nvidia.com/gpu requests on the vLLM pods. The scheduler is the only component here that actually knows about slots, and requests are how you let it do its job: a crash loop becomes a clean Pending. (Dropped requestGPU to co-locate engines on shared VRAM? You dropped your only enforcement layer.)

2 · Count

Do the slot math KEDA won’t

maxReplicaCount = floor(total GPUs ÷ GPUs per replica). Eight GPUs, 7-GPU replicas: that’s 1. Writing maxReplicaCount: 1 under an autoscaler feels absurd. It’s also the only honest number for that node, and the cap that stops KEDA from asking for replicas that can never land.

3 · Grow

Move capacity with demand

GPUs don’t pop out of thin air, but Karpenter or Cluster Autoscaler is the closest thing: it sees the clean Pending pod from step 1 and provisions a real node. KEDA adds pods, the node autoscaler adds nodes. Even llm-d’s roadmap admits it: “If I need N more GPUs of type X. Who fulfills that? Today: manual.” That is, if you’re lucky and rich enough to get H100 or B200 capacity at all.

4 · Signal

Fix the signal

Scale on what actually tracks load: queue depth (vllm:num_requests_waiting) and KV cache usage, straight from vLLM’s /metrics. Even keda-gpu-scaler agrees: v0.6.0 shipped a ready-made vllm-queue-depth profile to “scale on real serving-engine signals instead of proxying GPU utilization.”

Scale on the queue, not the silicon (shipped since v0.6.0). Two catches. On newer vLLM the KV gauge read 0 until v1.0.x, and 0 looks like idle, so KEDA would scale a busy server down. And vllmEndpoint behind a ClusterIP Service samples one random replica’s queue, not the fleet’s: it’ll happily read 0 while the real queue sits at 23. Triton’s profiles also read real engine metrics, but the TGI profile still just reads GPU memory.
See the queue-depth trigger
triggers:
  - type: external
    metadata:
      scalerAddress: "keda-gpu-scaler.keda.svc.cluster.local:6000"
      profile: "vllm-queue-depth"   # defaults: targetValue=5, activationThreshold=1
      vllmEndpoint: "http://vllm-svc:8000/metrics"

Running stock KEDA without the external scaler? Same move via the built-in Prometheus scaler on vllm:num_requests_waiting. The vLLM Production Stack Helm chart ships that exact trigger natively: you bring KEDA, flip monitoring on, and one values.yaml block scales on queue depth. Just budget for the 15 to 30 second metric path.

Scale-Down Tokenomic$: Zero Tokens, Full Price

KEDA scaling down doesn’t shrink your bill. Pods free GPU cards inside a node you rent whole, and the node bills either way. The metric that matters is cost per token, node-hours divided by tokens served, and every idle GPU-minute drives it up. Money left on the table.

Releasing the node itself is the autoscaler’s job, not KEDA’s, and on reserved capacity you won’t dare anyway. Freed cards only pay off if something else picks them up, and the best candidate is another model scaling up on the same node: one model goes quiet, its neighbor takes the cards. Batch jobs or training runs work too. Otherwise minReplicaCount: 0 is the worst deal in inference: full price for zero tokens.

Final Thoughts

So what’s the point of KEDA on GPUs? Honestly, not much on its own. Strip it down and it’s a fancier metrics server wrapped around the HPA: plumbing that feeds it a queue metric. That’s why llm-d and KServe keep it as their actuator, and why Dynamo built its own planner instead.

KEDA is the muscle, not the brain. It can’t make GPUs pop out of thin air, and no amount of tuning will teach it to count them. Even llm-d’s own autoscaling roadmap says so: “llm-d computes the target replica count; KEDA/HPA performs the scale operation.” If you keep it, give it a job it can do: real GPU requests so the scheduler enforces, an honest replica ceiling, a queue-depth signal instead of GPU utilization, and a node autoscaler to move the capacity beyond x node.

If you slice your GPUs, the signal gets even worse. With time-slicing or HAMi, several models share one card, so the utilization KEDA sees is everyone’s load added together, not your model’s. With MIG, NVML can’t see utilization per slice at all, so it reads 0 (you need DCGM for that). More on slicing in GPU Sharing: KAI vs HAMi vs MIG.

Hoping this gave you enough breadth to scale your inference without scaling your blood pressure. ✌️

What’s Next

GPU sharing on the same node: we might try HAMi and MIG on a quick lab. Stay tunned!

Don't miss a Bit!

Join countless others!
Sign up and get awesome cloud content straight to your inbox. 🚀

Start your Cloud journey with us today .

Share this...