Auto scaling overview
Updated at:
Auto scaling dynamically adjusts compute resources based on your workload and policies. Typical scenarios include elastic online services, large-scale training, and deep learning GPU or shared-GPU training and inference. Use the comparison below to select the scaling solution that fits your application.
Two dimensions of scaling:
-
Horizontal versus vertical: Horizontal scaling adjusts pod replica count. Vertical scaling adjusts CPU and memory per pod.
-
Reactive versus predictive: Reactive scaling responds to current metrics. Predictive scaling uses historical data to scale ahead of anticipated demand.
The four solutions:
| Solution | How it works | Scaling metrics | Use case | Supported resources | Documentation |
|---|---|---|---|---|---|
| HPA (Horizontal Pod Autoscaler) | Standard Kubernetes horizontal scaler and the most commonly used scaling solution for applications. Scales out pod replicas rapidly to relieve pressure when load rises, and scales in moderately to save resources when load falls. | CPU and memory usage; custom metrics | Online services with significant traffic fluctuation, a large number of services, and frequent scaling, such as e-commerce, online education, and financial services | Deployments and StatefulSets (any resource that implements the scale interface) |
Horizontal pod autoscaling |
| CronHPA (Cron Horizontal Pod Autoscaler) | Scales pods on a cron schedule. Supports time zones, specific dates, and exclusion dates such as holidays. Works alongside HPA. | Schedule-based | Applications with predictable peaks or time-specific tasks | Resources such as Deployments and StatefulSets | Use CronHPA for scheduled horizontal scaling |
| VPA (Vertical Pod Autoscaler) | Monitors pod resource consumption patterns, recommends CPU and memory requests and limits, and adjusts them automatically when conditions allow, without changing the replica count. | Observed pod CPU and memory usage | Stateful or monolithic applications needing stable resources; VPA adjustments typically take effect during pod anomaly recovery | Resources such as Deployments, DaemonSets, and StatefulSets | Vertical pod autoscaling |
| AHPA (Advanced Horizontal Pod Autoscaler) | Extends HPA with predictive scaling. Automatically detects traffic cycles from historical metrics and scales pods before demand arrives to avoid scaling lag. | CPU, memory, and GPU usage; queries per second (QPS); response time (RT); custom metrics | Applications with periodic traffic patterns, such as live streaming, online education, and gaming | Resources such as Deployments and Knative Services | AHPA overview |
Is this page helpful?