Autoscaling

On this page 7

Autoscaling is the automatic adjustment of compute capacity in response to measured or predicted demand: a control loop adds instances, containers or functions when load rises and removes them when it falls, within configured minimum and maximum limits. Its purpose is to meet performance targets with the least capacity that can sustain them.

In cloud economics, autoscaling is the mechanism that turns the pay-as-you-go pricing model into actual savings. A fleet sized for peak traffic around the clock wastes money for most of the day; an autoscaled fleet follows the demand curve. Within FinOps practice it is usually combined with reserved instances for the stable baseline and spot instances for interruptible extra capacity.

How autoscaling decides when to scale

Every autoscaler runs a feedback control loop: collect a metric, compare it with a target, compute the desired capacity and act. Because new capacity takes time to become useful, the loop includes warm-up periods that exclude booting instances from calculations and cooldowns or stabilization windows that prevent rapid oscillation.

The main policy types differ in how they compute the desired capacity, as the following table shows.

Policy typeHow it worksBest suited for
Target trackingKeeps a metric near a set value, such as 60 percent CPUMost web and API workloads
Step scalingAdds or removes fixed amounts at alarm thresholdsWorkloads needing graduated responses
Scheduled scalingChanges capacity at set timesKnown daily or weekly patterns
Predictive scalingForecasts load from history and scales aheadRecurring patterns with slow startup
Queue-based scalingSizes workers to backlog per workerAsynchronous job processing
Autoscaling policy types

Policies can be combined. A frequent design uses scheduled scaling to set the floor before known peaks and target tracking to handle everything in between. Most autoscalers are deliberately asymmetric, scaling out quickly to protect users and scaling in slowly to avoid removing capacity that will be needed again minutes later.

Horizontal, vertical and cluster autoscaling

Autoscaling operates on different dimensions. Horizontal scaling changes the number of instances, vertical scaling changes the size of each instance, and in container platforms cluster autoscaling changes the number of nodes that host the workloads.

DimensionTypical implementationStrengthLimitation
HorizontalVM scale groups, Kubernetes Horizontal Pod AutoscalerNear-linear capacity, resilienceNeeds stateless design
VerticalKubernetes Vertical Pod Autoscaler, instance resizeFixes poorly sized workloadsOften requires restarts
Cluster or nodeCluster Autoscaler, KarpenterMatches nodes to pending podsNode startup takes minutes
Event-drivenKEDA, serverless platformsCan scale to zeroCold starts on first request
Dimensions of autoscaling

In Kubernetes these layers interact: the pod autoscaler adds replicas, pending replicas trigger the node autoscaler, and bin-packing efficiency of the node layer determines how much of the theoretical saving is realized.

Key parameters and their economic effect

Autoscaling parameters are cost decisions in disguise. A conservative target wastes money continuously; an aggressive one risks latency spikes and failed requests during sudden surges.

ParameterCommon starting rangeRaising itLowering it
CPU utilization target50 to 70 percentLower cost, less headroomMore headroom, higher cost
Minimum capacityTwo or more instances across zonesBetter availabilityLower idle cost
Maximum capacitySet by budget and quotasAbsorbs extreme peaksCaps runaway spend
Scale-in delay5 to 15 minutesFewer oscillationsFaster savings
Instance warm-upMeasured boot plus readiness timeAvoids premature scale-outReacts faster
Autoscaling parameters and trade-offs

The choice of metric matters as much as its value. CPU utilization is convenient but misleading for I/O-bound or memory-bound services; requests per target or queue depth often track user demand more directly.

Autoscaling within a FinOps strategy

Autoscaling complements commitment discounts rather than replacing them. A common pattern covers the always-on baseline with reserved instances or savings plans, runs the variable middle on on-demand capacity, and fills interruptible peaks with spot instances, often through mixed-instance groups that spread risk across several instance types.

For cost allocation, autoscaled resources need consistent tags or labels applied by the launch template or pod specification, because instances that live for only minutes are otherwise impossible to attribute to a team or product. Scaling events and unit cost, such as cost per thousand requests, are better indicators of efficiency than total monthly spend alone.

Common pitfalls

  • Scaling a bottleneck that is elsewhere: adding web servers does not help when the database is saturated, and may make it worse.
  • Flapping: thresholds too close together and short cooldowns cause constant add-remove cycles.
  • Slow startup ignored: if instances need five minutes to serve traffic, reactive policies always lag a sudden spike.
  • No maximum limit: a bug, retry storm or attack can scale capacity and the bill without bound.
  • Stateful instances: local sessions or files are lost when scale-in terminates an instance.
  • Scaling on averages: an average hides hot partitions or single overloaded nodes.

Stripped to the essentials

Autoscaling means the cloud adds computers when it gets busy and removes them when it gets quiet, without anyone pressing a button. It follows the rules that engineers set in advance, such as keeping each machine about half busy.

It works like a supermarket that opens more checkout lanes when queues grow and closes them in the evening. Customers wait less at rush hour, and the shop does not pay staff to stand at empty tills.

Where it is applied

A ticket-selling platform sees modest traffic most of the week but extreme spikes when popular concerts go on sale. Previously it ran 60 servers continuously to survive those moments. The platform team moved the web tier to an autoscaling group with a minimum of 8 instances, a maximum of 120 and target tracking at 55 percent CPU.

Because sale times are announced in advance, scheduled scaling raises the minimum to 80 instances fifteen minutes before each sale, avoiding the lag of reactive policies. The baseline of 8 instances is covered by reserved capacity, and burst capacity mixes on-demand and spot instances. Average fleet size dropped to roughly a quarter of the old static fleet, compute spending fell sharply, and the platform handled its next major sale without timeouts.