Cloud & DevOps5h estimated

Auto-Scaling

Difficulty
Importance

The problem

Provisioning enough servers for peak traffic means paying for idle capacity most of the time, while provisioning for average traffic means falling over during a spike — auto-scaling adjusts the number of running servers automatically based on real-time demand, instead of guessing a fixed number upfront.

Why now

Load balancing already established a pool of interchangeable servers sharing traffic; auto-scaling is the missing piece that grows or shrinks that pool automatically, and CPU scheduling already established the general principle of allocating resources based on current demand rather than a fixed static assignment.

Mental model

Auto-scaling is a feedback loop, just like Kubernetes' reconciliation loop: continuously measure a signal (CPU usage, request rate), compare it to a target, and add or remove servers to close the gap — the load balancer already covered is what makes this possible at all, since new servers need somewhere to automatically start receiving traffic the moment they're ready.

Requires

Unlocks

Used in

Projects

  • Configure an auto-scaling policy (real or simulated) that adds instances when CPU usage exceeds a threshold and removes them when it drops, and test it under simulated load
  • Explain the tradeoff between an aggressive auto-scaling policy (fast to react, risk of thrashing) and a conservative one (slow to react, risk of under-provisioning)

Examples

  • An auto-scaling group configured to add an instance when average CPU exceeds 70% can absorb a traffic spike within minutes instead of requiring a human to notice and react
  • Scaling down too aggressively right after scaling up (thrashing) can cause repeated cycles of adding and removing capacity instead of settling

Resources

Mastery checklist