Add and remove servers by rules (target, step, schedule, prediction) so capacity follows the load.
Auto-scaling adds servers when load goes up and removes them when it goes down, using rules you set. Those rules are the scaling policy. A good policy keeps users fast without paying for idle machines.
Traffic is rarely flat. It rises in the morning, drops at night, and sometimes jumps because of a sale or a news story. If you buy for the peak, you waste money most of the day. If you buy for the average, you fall over at the peak. Auto-scaling closes that gap: a controller watches a metric, compares it with a goal, and changes the number of servers.
Scaling out (more servers) is called horizontal scaling and is what auto-scaling usually means. Scaling up (a bigger server) is vertical scaling. It often needs a restart, so it is rarely automatic.
| Policy | How it works | Good for | Watch out for |
|---|---|---|---|
| Target tracking | Keep one metric near a target (for example CPU 60%). The system works out how many servers | Most web services. The simplest good default | Slow metrics, and a poor choice of metric |
| Step scaling | Different actions for different sizes of breach (over 70%: +2, over 90%: +6) | Fast reaction to big jumps | More tuning, and steps can overshoot |
| Scheduled | Change capacity at fixed times | Known daily or weekly peaks, launches | Useless for surprises, and goes stale |
| Predictive | Forecast load from history and scale ahead of time | Regular patterns with slow warm-up | Needs enough history, and misses new patterns |
| Metric | Use when | Caution |
|---|---|---|
| CPU utilisation | Work is CPU-bound | Misleading if the bottleneck is memory, I/O or a database |
| Requests per target | Web or API traffic with similar cost per request | Needs the load balancer metric |
| Queue depth or message age | Workers pulling from a queue | Scale on work per worker, not raw depth |
| Latency | You care directly about user speed | It rises after you are already in trouble |
| Custom (active sessions, jobs) | Your own definition of load | Needs good instrumentation |
Illustrative model: one server handles 100 requests per second, one tick is 30 minutes, servers cost the same while starting as when serving, and scaling in is instant. Real systems add health checks, lifecycle hooks and billing rules.
| Term | Meaning in easy words |
|---|---|
| Auto-scaling | Changing the number of servers automatically based on rules |
| Horizontal scaling | Adding more servers |
| Vertical scaling | Using a bigger server |
| Scale out / scale in | Add servers / remove servers |
| Target tracking | Keep a metric near a chosen value |
| Step scaling | Bigger breaches trigger bigger changes |
| Scheduled scaling | Change capacity at fixed times |
| Predictive scaling | Scale ahead of time using a forecast |
| Cooldown | A pause after a scaling action before the next one |
| Warm-up | The time a new server needs before it can take full load |
| Flapping | Scaling up and down again and again |
| HPA | Kubernetes Horizontal Pod Autoscaler |
| Scale-in protection | Stops a busy or important server from being removed |
| Choice | We gain | We lose |
|---|---|---|
| Low target (50%) | Headroom for spikes | More idle servers, higher cost |
| High target (80%) | Lower cost | Little room for a surprise |
| Short cooldown | Reacts quickly | Flapping and wasted starts |
| Long cooldown | Stable | Slow to follow the load |
| Scheduled + reactive | Ready for known peaks and surprises | More rules to maintain |
| Predictive | Capacity is ready ahead of time | Needs history, wrong when patterns change |