Problem
Fixed capacity is either over-provisioned and wasteful or under-provisioned and slow during peaks. Manual scaling reacts too slowly to traffic spikes and is forgotten after they pass.
Also known as: elastic-scaling, auto-scaling-groups
Adjust compute capacity automatically in response to load so cost and performance track demand.
Fixed capacity is either over-provisioned and wasteful or under-provisioned and slow during peaks. Manual scaling reacts too slowly to traffic spikes and is forgotten after they pass.
Autoscaling is a feedback loop: measure load, compare to a target, change instance count. It works well when instances are stateless, start quickly and the scaling metric reflects real saturation.
desired = ceil(current * (observedMetric / targetMetric))
This is the formula used by the Kubernetes Horizontal Pod Autoscaler. If 10 pods run at 90 percent CPU against a target of 60 percent, the desired count is 15. Policies then clamp the result between min and max and apply stabilization windows, commonly short for scale-out and several minutes for scale-in.
Choose metrics that lead rather than lag. CPU works for compute-bound services, but requests in flight per instance or queue length per worker respond earlier for I/O-bound ones. Keep headroom: startup time of 60 to 120 seconds means you must scale before saturation, not at it. Scheduled actions pre-scale for known events.
Variable; pay for peak only when needed
Medium: tune policies and review limits
Medium: control-loop behavior
Flapping from short cooldowns causes constant churn
Scale-out overloads the database or hits quota limits
Max limit reached during an attack, producing a huge bill or an outage