Scaling Your Website on a Schedule
-
Assume that your e-Commerce website runs on ECS ecs-c9b4 in Huawei Cloud. You plan to launch a big promotion at 00:00 on a certain day. To respond to the demand spike during the promotion, you can take the following measures: enable Auto Scaling from Huawei Cloud for your website for automatic scaling, and configure a scaling policy to automatically add two ECSs for your website at 23:30 on the day before the promotion.
Step 1: Create an AS Configuration
1. Log in to the management console.
2. Choose Service List > Compute > Auto Scaling.
3. Click Create AS Configuration.
4. Configure parameters and click Create Now.
Note
1. In the Specifications pane, select General computing. This type of ECS provides a balance of compute, storage, and network resources and is applicable to most application scenarios. You can select multiple flavors to minimize the probability of scaling failures due to insufficient resources of a flavor.
2. Select Private image for Image. You can use the service ECS ecs-c9b4 to create a private image, and use the private image to create this AS configuration.
3. Select Encryption for data disks to improve disk data security. The system disk will not be encrypted if the image is not encrypted.
4. Select Password for Login Mode. You can also log in to an ECS using a key pair.
5. Select Do not configure for Advanced Settings.
1
Creating an AS configuration (1)
2
Creating an AS configuration (2)
View Image
Step 2: Create an AS Group
1. On the Instance Scaling page, click Create AS Group.
2. After configuring the parameters, click Create Now.
Note
1. When specifying AZ, ensure that the AZ where the service ECS resides is selected. Select Balanced for Multi-AZ Scaling Policy. When a scale-out event occurs, AS evenly distributes ECSs across the AZs you selected for high availability and reliability.
2. Set Max. Instances to 10, Expected Instances to 0, and Min. Instances to 0.
3. Select the AS configuration you created in Step 1.
4. Select the VPC where ECS ecs-c9b4 resides.
5. Select Elastic load balancer for Load Balancing. Access traffic will be automatically distributed to all available ECSs in the AS group.
1
Creating an AS group (1)
2
Creating an AS group (2)
View Image
Step 3: Add an AS Policy to the AS Group
1. On the AS Groups page, locate the created AS group and click View AS Policy.
2. Select Scheduled for Policy Type.
3. Set Triggered On to 23:30 on the day before the promotion.
4. Set Scaling Action to Add 2 instances.
5. Retain the default setting for Cooldown Period.
6. Click OK.
1
Adding a scheduled policy
View Image
Step 4: Manually Add Instances
1. Click the name of the created AS group and click the Instances tab.
2. Click Add, select the instances to be added, and click OK.
Note
You can add instances to an AS group only if the AS group is enabled and has no ongoing scaling action, and the number of current instances is less than the maximum number of instances.
1
Manually adding instances to an AS group
View Image
Step 5: View the Number of Instances
1. Before a scaling action is triggered, check that the AS group contains two ECSs and the expected number of instances is 2.
2. After a scaling action is triggered, check that the expected number of instances will change to 4 and AS will add two ECSs to the AS group based on the configured policy.
After the scaling action is complete, there will be four ECSs in the AS group, and you can cope with the increased demands with confidence.
1
Before a scaling action
2
After a scaling action
View Image
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