What Is Auto-Scaling?

Auto-scaling automatically adjusts the number of running server instances based on current demand, adding capacity under load and removing it when demand dro...

Published November 18, 2026

Auto-scaling automatically adds or removes servers (or containers) based on demand, such as CPU use or request count, so you stay fast under load and save money when idle.

The concept

A scaling policy watches metrics. When average CPU exceeds a threshold, new instances launch; when load falls, extras are terminated, within minimum and maximum limits.

Apps must be stateless and start quickly, and a load balancer must spread traffic across the changing pool.

Scale out and in

CPU 85% → +2 instances (2 → 4)
CPU 30% for 10 min → −1 instance (4 → 3)
limits: min 2, max 10

Practical examples

Kubernetes HPA

kubectl autoscale deployment web --cpu-percent=70 --min=2 --max=10

Policy as YAML

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata: { name: web }
spec:
  scaleTargetRef: { apiVersion: apps/v1, kind: Deployment, name: web }
  minReplicas: 2
  maxReplicas: 10
  metrics:
    - type: Resource
      resource: { name: cpu, target: { type: Utilization, averageUtilization: 70 } }

Cooldown to avoid flapping

Wait 5 minutes between scale-in actions

Common mistakes

  • No maximum, leading to runaway bills.
  • Slow start-up that cannot keep pace with spikes.
  • Scaling the app but not the database.

Key takeaways

  • Capacity follows demand.
  • Needs stateless apps and a load balancer.
  • Set min, max and cooldowns.

FAQ

Vertical vs horizontal auto-scaling?

Horizontal adds instances; vertical resizes them, usually needing a restart.

Predictive scaling?

Scales ahead of known patterns, such as daily peaks.

More General articles