A scaling group automatically adjusts resources to maintain service stability and cost-effectiveness as application load changes. During a scale-out or scale-in, Auto Scaling adds or removes instances from the scaling group based on a predefined scaling policy. Auto Scaling offers several predefined scaling policies. This topic explains how to configure them.
Scaling policies
By default, a scaling group scales instances based on the order of the vSwitches you configure. This behavior is called the priority policy. You can change the Scaling Policy to implement other strategies.
You can modify this setting only when the Type is ECS and the Network Type is VPC. When the Type is ECI, the default Scaling Policy is the Priority.
-
Priority (default policy)
Scales out or in based on the priority that you define for the vSwitches. During a scale-out event, the system first attempts to create an instance in the zone of the highest-priority vSwitch. If creation fails, the system automatically tries the zone of the next-highest priority vSwitch.
-
Distribution Balancing
Use this policy to keep instances in your scaling group evenly distributed across multiple zones to help achieve multi-zone disaster recovery. If the number of ECS instances becomes unbalanced across zones for reasons such as insufficient inventory, you can perform a rebalance. For more information, see Rebalance ECS instances.
-
Cost Optimization
Use the Cost Optimization when cost is a high priority. During a scale-out, this policy attempts to launch instances in ascending order of their vCPU unit price. If the scaling configuration includes multiple instance types that can be created as spot instances, the policy prioritizes these spot instances. If launching spot instances fails for reasons such as insufficient inventory, the policy automatically attempts to create pay-as-you-go instances. During a scale-in, the instance with the highest vCPU unit price is removed first.
-
Custom Combination Policy
This policy gives you fine-grained control over your capacity distribution. You can use it to adjust the ratio of pay-as-you-go to spot instances, balance capacity across zones, and define the instance type selection strategy.
For configuration instructions, see Configure a scaling policy.
Configure a scaling policy
Existing scaling group
To modify the Scaling Policy of an existing scaling group, follow these steps.
-
Log on to the Auto Scaling console.
In the left-side navigation pane, click Scaling Groups.
In the top navigation bar, select the region where Auto Scaling is activated.
-
On the Scaling Groups page, find the scaling group whose Scaling Policy you want to modify and click Edit in the Actions column to open the Edit Scaling Group window.
-
Set the Scaling Policy.
If you select the Distribution Balancing, Cost Optimization, or Custom Combination Policy, you must also configure the sub-settings. For more information, see Sub-settings.
-
Click OK.
New scaling group
You can configure the Scaling Policy when you create a scaling group on the console, as the following figure shows.

If you select the Cost Optimization or Custom Combination Policy, you must also configure the sub-settings. For more information, see Sub-settings.
Parameters
If you select the Distribution Balancing, Cost Optimization, or Custom Combination Policy, see the following tables for configuration details.
Balanced distribution policy
|
Parameter |
Description |
|
Balanced Mode |
|
|
Enable Auto-rebalance |
If enabled, the scaling group automatically monitors capacity across availability zones. If the instance distribution becomes unbalanced, the scaling group automatically starts a scaling activity to rebalance the instances. |
Cost optimization policy
|
Parameter |
Description |
|
Minimum Number of Pay-as-you-go Instances |
The minimum number of pay-as-you-go ECS instances to maintain in the scaling group. The default is 0. If the number of pay-as-you-go instances in the group falls below this value, the scaling group prioritizes creating pay-as-you-go instances during scale-out events. |
|
Percentage of Pay-as-you-go Instances |
The percentage of pay-as-you-go instances among automatically created ECS instances is 70% by default. This calculation does not include the minimum number of pay-as-you-go instances in the group. |
|
Lowest Cost Instance Types |
Specifies the number of lowest-priced instance types to use. The default is 1. This parameter applies only if you specify multiple instance types in the scaling configuration. When creating preemptible instances, the scaling group distributes new instances evenly across this number of lowest-priced instance types. |
|
Enable Supplemental Spot Instances |
If enabled, the scaling group automatically replaces a preemptible instance approximately 5 minutes before it is reclaimed. |
|
Use Pay-as-you-go Instances to Supplement Spot Capacity |
Enabled by default. If the required preemptible instance capacity is unavailable due to price or stock, the scaling group attempts to create pay-as-you-go instances to meet the demand. |
|
Replace Pay-as-you-go Instance with Spot Instance |
When Use Pay-as-you-go Instances to Supplement Spot Capacity is enabled, the proportion of pay-as-you-go instances in the group may exceed the specified Percentage of Pay-as-you-go Instances. If you enable this option, the scaling group attempts to replace pay-as-you-go instances with preemptible instances to maintain the desired ratio. |
Custom combination policy
|
Parameter |
Description |
|
Minimum Number of Pay-as-you-go Instances |
The minimum number of pay-as-you-go ECS instances to maintain in the scaling group. The default is 0. If the number of pay-as-you-go instances in the group falls below this value, the scaling group prioritizes creating pay-as-you-go instances during scale-out events. |
|
Percentage of Pay-as-you-go Instances |
The percentage of pay-as-you-go instances among automatically created ECS instances is 70% by default. The number of instances that corresponds to the minimum number of pay-as-you-go instances in the group is excluded from this calculation. |
|
Multi-zone Balanced Distribution |
Distributes ECS instances evenly across the multiple availability zones specified for the scaling group (via multiple vSwitches). Note
You can also manually trigger a rebalance to redistribute ECS instances across availability zones. For more information, see Rebalance ECS instances. |
|
Capacity Planning Policy |
Determines how the scaling group selects available instance types to fulfill capacity requirements.
|
|
Configure Spot Capacity Planning Policy |
If enabled, you can specify a separate capacity distribution policy for preemptible instances. |
|
Spot Capacity Planning Policy |
Same as Capacity Planning Policy. |
|
Lowest Cost Instance Types |
Specifies the number of lowest-priced instance types to use. The default is 1. This parameter applies only if you specify multiple instance types in the scaling configuration. When creating preemptible instances, the scaling group distributes new instances evenly across this number of lowest-priced instance types. |
|
Enable Supplemental Spot Instances |
If enabled, the scaling group automatically replaces a preemptible instance approximately 5 minutes before it is reclaimed. |
|
Use Pay-as-you-go Instances to Supplement Spot Capacity |
Enabled by default. If the required preemptible instance capacity is unavailable due to price or stock, the scaling group attempts to create pay-as-you-go instances to meet the demand. |
|
Replace Pay-as-you-go Instance with Spot Instance |
When Use Pay-as-you-go Instances to Supplement Spot Capacity is enabled, the proportion of pay-as-you-go instances in the group may exceed the specified Percentage of Pay-as-you-go Instances. If you enable this option, the scaling group attempts to replace pay-as-you-go instances with preemptible instances to maintain the desired ratio. |
Modify a scaling policy by API
Call the ModifyScalingGroup API operation to modify a scaling group's scaling policy. The required parameters depend on the chosen policy, as described in the following sections.