Background information
The following traditional methods are used to manage the pods of an application: manually specify the number of pods, use HPA, and use CronHPA. The following table describes the disadvantages of the preceding methods.
Method | Disadvantage |
Manually specify the number of pods | Resources are wasted and you are charged for idle resources during off-peak hours. |
Use HPA | Scaling activities are performed after a scaling delay. Scale-out activities are triggered only if the resource usage exceeds the threshold and scale-in activities are triggered only if the resource usage drops below the threshold. |
Use CronHPA | You need to specify the number of pods required during each time period. If you specify an excessive number of pods, resources are wasted. If you do not specify sufficient pods, the resource demand cannot be met. You must modify the scaling policy to adapt to the fluctuating workloads.
|
ACK clusters provide the AHPA feature that supports predictive scaling. You can use AHPA to increase resource utilization and improve the efficiency of resource management. AHPA can analyze historical data and predict the number of pods that are required per minute within the next 24 hours. If you use CronHPA, you must manually create 1,440 (24 hours × 60 minutes) schedules instead. The following figure shows the difference between traditional horizontal pod scaling and predictive horizontal pod scaling.
Traditional horizontal pod scaling: Scale-out activities are triggered after the amount of workloads increases. The system cannot provision pods at the earliest opportunity to handle the fluctuating workloads due to the scaling delay.
Predictive horizontal pod scaling: AHPA identifies workload fluctuations based on the historical values of specific metrics and the amount of time that a pod spent before the state of the pod changes to Ready. This way, AHPA can provision pods that are ready to be scheduled before a traffic spike occurs. This ensures that resources are allocated at the earliest opportunity.
