Introduction
Cloud-native computing relies heavily on Kubernetes (k8s) for orchestration. A critical component is the Horizontal Pod Autoscaler (HPA), which adjusts the number of pods based on resource utilization. However, traditional HPA is reactive, leading to "elastic lag"—a delay where resources are only provisioned after a spike occurs, causing performance degradation. AHPA (Adaptive Horizontal Pod Autoscaling) is an AI-driven framework deployed on Alibaba Cloud to address this by shifting from reactive to proactive scaling.
Problem Statement
Traditional scaling methods face several challenges:
- Reactive HPA: Responds only after thresholds are breached, causing bottlenecks during sudden surges.
- CronHPA: Scheduled scaling is inflexible and requires manual expert tuning.
- Resource Inefficiency: Over-provisioning to ensure stability leads to significant idle resource costs.
The goal is to accurately predict pod requirements using noisy, real-world telemetry data to ensure resources are ready before demand peaks.
Methodology
AHPA implements a three-stage pipeline to automate proactive scaling.
1. Future Workload Forecasting
AHPA utilizes robust decomposition algorithms like RobustPeriod for cycle detection and RobustSTL/RobustTrend to separate signals into trend, seasonality, and residuals. For complex patterns, deep learning models such as FEDformer and Quatformer are integrated to filter noise and capture long-term business cycles.
2. Performance Model Training
To map business metrics (e.g., QPS) to infrastructure needs, AHPA employs Queuing Theory (M/M/1 and M/M/c models). This allows the system to determine the minimum pod count required to maintain target Response Time (RT) thresholds.
3. Scaling Plan Generation
A key innovation is the proactive shift algorithm. By accounting for pod initialization time (e.g., 1 minute), AHPA triggers scaling actions ahead of predicted peaks to eliminate startup lag.
Evaluation and Results
The system was tested on Alibaba Cloud Container Service (ACK) using 14 days of 1-minute granularity data across various scenarios: periodicity (NP, WP, SP) and robustness (NoisyData, MissingData, TrendChange).
Key results include:
- Cost Savings: Average resource cost reduction of over 20%, reaching 28% in specific intelligent voice services.
- Utilization: CPU utilization increased by 10% due to reduced over-provisioning.
- Stability: In noisy environments, AHPA maintained a 2.7% QoS violation rate compared to 30% for standard HPA.
- Operational Scale: In a production voice scenario, AHPA manages ~1,000 daily scaling events, saving approximately $10,000 daily.
Conclusion
AHPA successfully bridges the gap between business KPIs and infrastructure scaling. By combining robust time-series forecasting with queuing theory and proactive execution, it significantly improves resource efficiency and service stability on Alibaba Cloud. Future work includes exploring alternative abstraction theories and broader integration across cloud services.
Summary updated