What Is Autoscaling? Cloud Scaling Policies Explained
Autoscaling adds or removes compute capacity automatically as demand changes. How target tracking, step, scheduled, and predictive policies work.
Autoscaling is the practice of automatically adding or removing compute capacity — virtual machines, containers, or function instances — based on demand. Instead of provisioning enough servers for your busiest hour and paying for them all day, you define rules that grow the fleet when load rises and shrink it when load falls. Done well, autoscaling keeps an application responsive during spikes and cuts costs during quiet periods. Done poorly, it oscillates, scales too late, or quietly runs up a bill.
What gets scaled
Autoscaling almost always means horizontal scaling: changing the number of instances rather than the size of each one. Horizontal scaling can happen without downtime, while resizing a single machine usually requires a restart. Horizontal vs vertical scaling covers that distinction in depth.
Common targets include:
- Groups of virtual machines behind a load balancer.
- Container replicas in an orchestrator such as Kubernetes, where the Horizontal Pod Autoscaler adjusts replica counts and a separate cluster autoscaler adds nodes when pods don’t fit. See Kubernetes HPA vs VPA.
- Serverless functions, where the platform scales instances per request with no configuration — but with trade-offs like cold starts.
- Managed databases and queues that offer read-replica or throughput autoscaling.
The control loop
Every autoscaler runs the same basic loop:
- Measure a metric — CPU utilization, requests per second, queue depth, response latency.
- Compare it to a target or threshold.
- Decide how many instances are needed.
- Act by launching or terminating instances.
- Wait for the change to take effect, then repeat.
The details of steps 3 and 5 are where policies differ.
Types of scaling policies
| Policy | How it decides | Strengths | Weaknesses |
|---|---|---|---|
| Target tracking | Keeps a metric near a set value (for example, 50% average CPU) | Simple to configure; self-adjusting | Reactive; assumes the metric scales roughly linearly with load |
| Step scaling | Adds or removes a set amount when a metric crosses thresholds | Fine-grained control over large vs small spikes | More tuning; easy to misconfigure |
| Scheduled | Changes capacity at fixed times | Ideal for known daily or weekly patterns | Doesn’t react to unexpected load |
| Predictive | Forecasts load from historical patterns and scales ahead | Capacity is ready before the spike arrives | Needs consistent history; can be wrong on unusual days |
Many production setups combine them: scheduled or predictive scaling raises the baseline before expected peaks, and target tracking handles whatever the forecast missed.
Choosing the right metric
The metric should track the resource that actually limits your service.
- CPU utilization works for compute-heavy services but misleads for I/O-bound ones, which can be overloaded while CPU sits low.
- Requests per instance maps directly to load for stateless web services.
- Queue depth or backlog per worker is usually best for background job processors: if the queue grows, add workers.
- Latency is closest to what users feel, but it reacts late and can be driven by a slow dependency that more instances won’t fix.
A useful check: if doubling instances wouldn’t halve the metric, it’s probably the wrong one to scale on.
Cooldowns, warm-up, and flapping
New instances aren’t useful the moment they launch. They need to boot, pull code or images, warm caches, and pass health checks — the liveness and readiness probes in Kubernetes terms. If the autoscaler measures again before the new capacity is serving, it sees the same high metric and adds even more instances.
Cooldown or stabilization windows prevent that by pausing further scaling decisions for a period after each action. They also prevent flapping, where the fleet repeatedly scales up and down around a threshold. A common pattern is to scale out quickly and scale in slowly: adding capacity late hurts users, while removing it late only costs a little money.
Minimums, maximums, and safety rails
Every autoscaling group should define:
- A minimum that keeps enough capacity for baseline traffic and survives the loss of an instance or availability zone.
- A maximum that caps cost and protects downstream systems. If your service scales to hundreds of instances but your database can only accept a fixed number of connections, unlimited scaling turns a traffic spike into a database outage.
- Graceful scale-in. Instances chosen for termination should stop accepting new work and finish in-flight requests first — see graceful shutdown explained.
Requirements for scaling well
Autoscaling only works if the application can tolerate instances appearing and disappearing:
- Stateless instances. Sessions, uploads, and caches that must survive belong in shared stores, not on local disk.
- Fast startup. Smaller images and lighter initialization shorten the gap between a spike and new capacity.
- Health checks that mean something. An instance that passes checks but can’t serve requests will receive traffic anyway.
- Observability. You can’t tune a policy you can’t see; scaling events, metric values, and latency belong on the same dashboard. What is observability covers the foundations.
Cost considerations
Autoscaling saves money mainly when demand varies. A flat workload gains little. Scaling on interruptible capacity such as spot instances can cut costs further for fault-tolerant workloads — see the AWS spot instances tutorial. Tracking the results belongs to the broader discipline of FinOps.
The takeaway
Autoscaling is a feedback loop that adjusts instance counts to match demand. Target tracking is the simplest starting point, scheduled and predictive policies get ahead of known peaks, and step scaling offers fine control. Pick a metric that truly reflects your bottleneck, scale out fast and in slowly, set sane minimums and maximums, and make sure your application is stateless and starts quickly enough for new capacity to matter.
Tagged
Keep reading
Chisato · · 5 min read What Is an Error Budget? SLOs Turned Into a Policy
An error budget is the unreliability an SLO allows, such as 0.1% of requests for a 99.9% target. How to calculate it, track burn rate, and act on it.
The Lycoris Team · · 5 min read What Is Toil in SRE? Spotting and Reducing Operational Toil
Toil is manual, repetitive, automatable operations work that grows with your service. How SRE teams define it, measure it, and engineer it away.
Chisato · · 4 min read What Is a Cloud Landing Zone?
A cloud landing zone is a pre-configured, secure baseline environment for provisioning new cloud accounts and workloads at scale. How it works.