NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

AHPA: Adaptive Horizontal Pod Autoscaling Systems on Alibaba Cloud Container Service for Kubernetes

Zhiqiang Zhou, Chaoli Zhang, Lingna Ma, Jing Gu, Huajie Qian, Qingsong Wen, Liang Sun, Peng Li, Zhimin Tang

Abstract

The existing resource allocation policy for application instances in Kubernetes cannot dynamically adjust according to the requirement of business, which would cause an enormous waste of resources during fluctuations. Moreover, the emergence of new cloud services puts higher resource management requirements. This paper discusses horizontal POD resources management in Alibaba Cloud Container Services with a newly deployed AI algorithm framework named AHPA -- the adaptive horizontal pod auto-scaling system. Based on a robust decomposition forecasting algorithm and performance training model, AHPA offers an optimal pod number adjustment plan that could reduce POD resources and maintain business stability. Since being deployed in April 2021, this system has expanded to multiple customer scenarios, including logistics, social networks, AI audio and video, e-commerce, etc. Compared with the previous algorithms, AHPA solves the elastic lag problem, increasing CPU usage by 10% and reducing resource cost by more than 20%. In addition, AHPA can automatically perform flexible planning according to the predicted business volume without manual intervention, significantly saving operation and maintenance costs.

Introduction: The Challenge of "Elastic Lag"

In cloud-native environments, traffic is rarely static. It fluctuates in "peaks and valleys" driven by user behavior, marketing events, or cyclical patterns. Traditionally, Kubernetes manages these fluctuations using two methods: static allocation, which wastes resources during low traffic, or the Horizontal Pod Autoscaler (HPA), which is reactive.

The primary drawback of HPA is "elastic lag." Because it takes time to pull container images and initialize new pods, a reactive system often scales up too late, leading to performance bottlenecks or service outages during sudden spikes. Manual scheduling (CronHPA) attempts to solve this but requires constant expert intervention and fails to handle unexpected fluctuations. AHPA (Adaptive Horizontal Pod Autoscaling) was developed to bridge this gap by being both proactive and automated.

The AHPA Framework

The AHPA system consists of three primary modules designed to transform raw metrics into actionable, proactive scaling plans.

The AHPA framework architecture, illustrating the flow from historical data to the final scale plan generation.

1. Future Workload Forecasting

Instead of simple linear projections, AHPA utilizes a robust decomposition-based statistical method. It employs RobustPeriod to detect multiple periodicities and RobustSTL/RobustTrend to break data into trend, seasonality, and residual components. For highly complex traffic patterns, it integrates advanced deep learning models such as FEDformer and Quatformer.

2. Performance Model Training

Predicting traffic (QPS) is only half the battle; the system must also determine how many pods are required to handle that traffic. AHPA uses Queuing Theory (specifically M/M/1 and M/M/c models) to map business metrics like Response Time (RT) and Queries Per Second (QPS) to the optimal number of pods.

3. Scale Plan Generation and Forecasting Shift

To account for the "cold start" time of pods, AHPA uses a forecasting shift algorithm. If a pod takes one minute to become ready, AHPA executes the scaling action at least one minute in advance of the predicted peak. This eliminates the lag seen in traditional systems.

Comparison of pod scaling actions: AHPA (left) shifts scaling actions forward to meet demand proactively, while traditional HPA (right) suffers from a 1-minute lag.

Key Insights and Implementation

  • Predicting the "Upper Bound": For the residual (noise) part of the time series, AHPA uses Quantile Regression Forest. This allows the system to predict an upper bound for potential traffic, providing a safety buffer that prioritizes service stability.
  • Queuing Theory vs. Heuristics: By using queuing theory rather than simple "target average utilization" rules, AHPA can select different models based on the number of pods available, outperforming simple linear scaling when pod counts are low.
  • Zero-Touch Maintenance: The system is designed to be self-learning. Once launched, it continuously adapts to new data patterns, requiring minimal manual tuning.

Results and Impact

Since its deployment in April 2021, AHPA has demonstrated significant improvements over standard Kubernetes HPA across diverse sectors like e-commerce, logistics, and online education:

  • Cost Efficiency: Reduced resource costs by more than 20% (reaching up to 28% in specific voice-processing scenarios).
  • Resource Utilization: Increased average CPU usage by 10% by trimming excess capacity during low-traffic periods.
  • System Stability: In scenarios involving noisy or missing data, AHPA maintained a Violation Rate (VR) of approximately 0.03, whereas traditional HPA saw violation rates as high as 0.30.

Conclusion

AHPA successfully addresses the "elastic lag" problem by combining robust time-series forecasting with queuing theory. While the current mapping of workloads to pods is effective, future work will investigate alternative theoretical frameworks to further refine pod allocation for highly volatile or niche business scenarios.

Summary updated

BibTeX
@inproceedings{zhou2023ahpa,
  author = {Zhiqiang Zhou and Chaoli Zhang and Lingna Ma and Jing Gu and Huajie Qian and Qingsong Wen and Liang Sun and Peng Li and Zhimin Tang},
  title = {{AHPA: Adaptive Horizontal Pod Autoscaling Systems on Alibaba Cloud Container Service for Kubernetes}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2023},
  doi = {10.1609/aaai.v37i13.26852},
}
Figure