Auto Scaling Overview
Background
In conventional application deployment, resource capacity is typically static and fixed. When there are unexpected traffic surges (such as during e-commerce promotions, popular game launches, or breaking news), fixed compute resources can easily lead to system overload, slow service response, or even crashes. Conversely, during off-peak hours, a large number of servers are idle for a long time, resulting in significant waste of IT costs. As a serverless container platform, CCI boasts one of its core advantages: superb auto scaling, which enables on-demand use of compute resources. That means resources are allocated when needed and released when they are no longer needed. This completely resolves the conflict between resource waste and performance bottlenecks, enabling developers to focus on their services rather than planning underlying resource capacity.
Principles
CCI uses HorizontalPodAutoscaler (HPA) policies to scale resources in seconds, meeting the dynamic resource demands.
Principles: HPA periodically and automatically adjusts the expected scale of a Deployment to match the metrics you set. The system periodically checks the real-time resource usage of the workload. When the actual resource usage (such as CPU or memory) exceeds the expected value (for example, 50%) set in the HPA policy, the HPA engine automatically triggers scale-out to dynamically increase the number of pods for the Deployment to distribute the concurrent load. Conversely, when the traffic decreases and the resource usage falls below the security threshold, the system smoothly and automatically scales in and reclaims idle pod resources. By setting the minimum and maximum numbers of replicas, you can control the scaling within an expected and secure range.
Typical Application Scenario and Example
- Application scenario: Applications such as live streaming, news, and food delivery usually experience significant traffic peaks and troughs in a single day, and sometimes face unpredictable traffic bursts. With HPA, the system can automatically and quickly respond to traffic surges without manual intervention.
- Service example: The order processing module of an e-commerce platform is deployed using CCI, and the platform experiences a surge in orders during a holiday. The O&M personnel configure an HPA policy for the Deployment in CCI, with the setting to trigger a scale-out when the CPU usage reaches 50% and retain a minimum of 2 replicas and a maximum of 50 replicas.
- Peak hours: At 11:30, the traffic starts to surge, and the CPU usage increases rapidly. Once the HPA engine detects that the CPU usage exceeds 50%, it immediately and automatically adds more pods. The number of pods is increased from 2 to a higher number until the current concurrent requests can be fully handled.
- Off-peak hours: During the peak hours after 13:00, the traffic decreases, and the CPU usage drops. The system then automatically reduces the number of pods to 2, which is the minimum number. This process is fully automated, which ensures smooth operation of the order system during peak hours and maximizes cost savings on compute during off-peak hours.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot