A scaling rule defines specific scaling actions; for example, adding or removing ECS instances. If, as a result of executing a scaling rule, the number of ECS instances in a scaling group is less than the MinSize value or greater than the MaxSize value, Auto Scaling automatically adjusts the number of ECS instances to be added or removed. This occurs by executing the adjust scaling group instance quantity to MinSize or MaxSize rules.
For example, a scaling group is created with MaxSize 3, Total Capacity is 2, and the scaling rule is Add 3 ECS instances. In this case, Auto Scaling only adds 1 ECS instance (the scaling rule will still be set to Add 3 ECS instances, but the Adjust scaling group instance quantity to MaxSize rule will also be run).
Imagine a second scaling group, in which MinSize is 2, Total Capacity is 3, and the scaling rule is Remove 5 ECS instances. Here, Auto scaling only removes 1 ECS instance (since the Adjust scaling group instance quantity to MinSize rule will also be run).
You can create a scaling rule according to input parameters.
If Adjusted Type is set to Adjust to Specified Total Capacity, the corresponding Adjusted Value must be greater than or equal to 0.
If Adjusted Type is set to Percent Change In Capacity, Auto Scaling computes the number of ECS instances to be added or removed by using the following formula: current number of ECS instances (Total Capacity) * Adjusted Value/100, rounding the result to the nearest integer.
After a scaling activity is executed for a scaling group, the group is cooled down for the time specified in the scaling rule. If not specified in the scaling rule, the Default cool-down time of the scaling group is applied.
You can create up to 10 scaling rules for a single scaling group.
After a scaling rule is created, a unique scaling rule identifier (scaling rule ARI) is generated and used in these OpenAPIs:
Set it in the ScalingRuleAri parameter of the ExecuteScalingRule interface, and you can manually execute the scaling rule.
Set it in the ScheduledAction parameter of the CreateScheduledTask interface, and you can schedule the execution of the scaling rule.
Set it in the AlarmActions parameter of the CloudMonitor PutAlarmRule interface, and you can dynamically execute the scaling rule with the performance indicators.
On the Scaling rule page, click Create scaling rule.
Enter the rule name and set the parameters.
In the Create Scaling rule dialog box, click Create Scaling rule. The new scaling rule will be displayed on the Scaling rule page.