What Is Autoscaling and How Does It Work?
.png)
Autoscaling changes the amount of compute a service uses dynamically, according to its current load. As traffic increases, more resources are provisioned. When traffic falls, the resources are reduced.
Otherwise, you have to guess at sizing. If you size for your peak hour, you are overprovisioned all day long. If you size for the average, your service is overloaded at the slightest spike. Autoscaling eliminates that trade-off.

How does autoscaling work?
Every autoscaler runs the same loop:
- Measure. It reads a signal such as request rate, CPU, GPU use or queue length.
- Compare. It checks the signal against a target you set, for example 70% CPU or 5 requests in flight per replica.
- Scale out. If demand is above target, it starts more instances.
- Scale in. If demand stays below target, it removes instances.
- Wait. A cooldown stops it from adding and removing capacity every few seconds.

The main part of the art lies in selecting the signal and the thresholds. Scaling too slowly causes noticeable lag in the middle of a load spike. An overly aggressive approach leads to wasted resources or thrashing.
Types of autoscaling
Teams usually combine these rather than picking one.

Autoscaling in Kubernetes
Kubernetes distributes this work between a few components, since pod scaling and node scaling are two different problems.
In Kubernetes, you use HPA for pod scaling, and Karpenter or Cluster Autoscaler to add nodes if pods have no place to be deployed. KEDA is the usual solution for event-based autoscaling or going down to zero.Autoscaling changes the amount of compute a service uses dynamically, according to its current load. As traffic increases, more resources are provisioned. When traffic falls, the resources are reduced.
Autoscaling for GPU and LLM workloads
AI inference breaks some of the habits that work for web apps.
- CPU is the wrong signal. A GPU can be saturated while CPU looks idle. Scale on requests in flight, queue depth or tokens per second instead.
- Cold starts are slow. A new replica may need a GPU node, a multi-gigabyte image pull and model weights loaded into memory. That can take minutes, so keep a warm minimum for latency-sensitive endpoints.
- Capacity is scarce. GPUs of a given type are not always available on demand, so set a maximum and have a fallback plan.
- Idle is expensive. This is where scale to zero pays off for dev, staging and rarely used models.
TrueFoundry runs model deployments on Kubernetes in your own cloud account. You set minimum and maximum replicas and the scaling behavior per deployment, and it takes care of the cluster underneath. See the AI Gateway for how traffic is routed across those deployments, and load balancing for how requests are spread across replicas.
Best practices
- Scale on a metric that reflects real load for your workload, not the one that is easiest to read.
- Set a minimum to protect latency and a maximum to protect your budget.
- Use cooldowns so the system does not flap.
- Pre-warm or keep a spare replica where cold starts hurt.
- Load test to find where one replica tops out before you set targets.
- Track scaling events and cost together, and tune the rules over time.
Related: scale to zero, load balancing and LLM cost optimization.

Govern, Deploy and Trace AI in Your Own Infrastructure
Frequently Asked Questions
What is autoscaling in simple terms?
It lets a service automatically add compute when demand rises and remove it when demand falls. You stay responsive during busy periods without paying for extra capacity when things are quiet.
What is the difference between scaling out and scaling up?
Scaling out adds more instances to share the load, the common approach for web and inference. Scaling up moves to bigger instances with more CPU, memory, or GPU for heavier individual jobs. Many systems use both.
How does autoscaling decide when to scale?
It monitors signals like request rate, CPU/GPU usage, or queue length and checks whether they cross the thresholds you set. When demand crosses a threshold it adds or removes capacity, with cooldowns to avoid scaling back and forth too fast.
How is autoscaling related to scale to zero?
Scale to zero is the extreme of scaling in: dropping to no instances when fully idle. Standard autoscaling normally keeps at least one running, while scale to zero pays nothing when idle at the cost of a cold start.
Why does autoscaling matter for GPUs?
Because GPUs are expensive, running a fixed number sized for peak wastes money off-peak, while too few fail under load. Autoscaling GPU services with demand balances performance and cost, which is central to affordable AI.

















