Scaling policies
A scaling group automatically adjusts resources to handle changes in application load, which ensures service stability and cost efficiency. When a scale-out or scale-in activity is triggered, the scaling policy determines which instances are added to or removed from the scaling group. Auto Scaling provides several preset scaling policies that you can configure in the console or by calling an API operation.
Scaling Policy Description
By default, a scaling group performs scaling activities based on the order of the vSwitches that you configure (the Priority policy). You can change the Scaling Policy to use another policy. Several scaling policies are preset for scaling groups:
This configuration can be modified only when Type is ECS and Network Type is VPC. When Type is ECI, the default Scaling Policy is Priority.
Priority (the default policy).
Scale based on the vSwitches that you define. If instances cannot be created in the zone of the higher-priority vSwitch, instances are automatically created in the zone of the next-priority vSwitch.
Distribution Balancing.
Use this policy to keep the scaling group evenly distributed across zones after scaling activities and achieve multi-zone disaster recovery. If the number of ECS instances becomes unbalanced across zones due to reasons such as insufficient inventory, you can rebalance the instance distribution across zones. For more information, see Rebalance ECS instances.
Cost Optimization.
Use the Cost Optimization policy to prioritize cost when the scaling group scales. When a scale-out activity occurs, the system attempts to create instances in ascending order of the vCPU unit price. If the scaling configuration specifies multiple instance types that use the spot billing method, the corresponding spot instances are created first. If none of the spot instance types can be created due to reasons such as insufficient inventory, the system automatically attempts to create instances on a pay-as-you-go basis. When a scale-in activity occurs, the instances with the highest vCPU unit price are removed first.
Custom Combination Policy.
Customize the capacity distribution policy by using a combination of settings. You can use this policy to adjust the ratio of pay-as-you-go instances to spot instances in the scaling group, balance capacity across zones, and select instance types.
For information about how to configure this policy, see Configure a scaling policy .
Configure a scaling policy
Change the scaling policy of an existing scaling group
To change the Scaling Policy of an existing scaling group, perform the following steps:
Log on to the Auto Scaling console.
In the navigation pane on the left, click Scaling Groups.
In the top navigation bar, select a region.
On the Scaling Groups page, find the scaling group whose Scaling Policy you want to change. In the Actions column on the right, click Edit. The Edit Scaling Group dialog box appears.
Set Scaling Policy to the policy that you want.
If you select Distribution Balancing, Cost Optimization, or Custom Combination Policy, you must further complete the child configuration items. For more information about the child configuration items, see Sub-configuration Item Description.
Click OK to complete the configuration.
Configure the scaling policy when you create a scaling group
You can configure the Scaling Policy when you create a scaling group, as shown in the following figure.

If you select Cost Optimization or Custom Combination Policy, you must further complete the child configuration items. For more information about the child configuration items, see Sub-configuration Item Description.
Sub-configuration Item Description
If you set the scaling policy to Distribution Balancing, Cost Optimization, or Custom Combination Policy, refer to the following tables to complete the configuration.
Balanced Distribution Policy
Configuration item | Description |
Balanced Mode |
|
Enable Auto-rebalance | After this feature is enabled, the scaling group automatically detects zone capacity. When the zone capacity is unbalanced, the scaling group proactively scales across zones to rebalance the zone capacity. |
Cost Optimization Policy
Configuration item | Description |
Minimum Number of Pay-as-you-go Instances | The minimum number of pay-as-you-go ECS instances required by the scaling group. Default value: 0. If the number of pay-as-you-go ECS instances in the scaling group is less than this value, pay-as-you-go instances are created first. |
Percentage of Pay-as-you-go Instances | The percentage of pay-as-you-go instances among the ECS instances that are automatically created. Default value: 70%. The instances that correspond to the minimum number of pay-as-you-go instances in the scaling group are excluded when this value is calculated. |
Lowest Cost Instance Types | The number of instance types with the lowest price. Default value: 1. This setting takes effect when multiple optional instance types are specified in the scaling configuration. When spot instances are created, the scaling group evenly creates ECS instances across the instance types with the lowest prices. |
Enable Supplemental Spot Instances | After supplemental spot instances are enabled, the scaling group proactively creates a new spot instance and replaces the spot instance that is about to be reclaimed 5 minutes before the reclamation. |
Use Pay-as-you-go Instances to Supplement Spot Capacity | Enabled by default. If the required spot instance capacity cannot be met due to reasons such as price or inventory, enabling this feature allows the scaling group to attempt to create pay-as-you-go instances to meet the current spot instance capacity. |
Replace Pay-as-you-go Instance with Spot Instance | After Use Pay-as-you-go Instances to Supplement Spot Capacity is enabled, the percentage of pay-as-you-go instances in the scaling group may exceed the Percentage of Pay-as-you-go Instances. You can enable this option. After it is enabled, the scaling group attempts to replace pay-as-you-go instances with spot instances. |
Custom Combination Policy
Configuration item | Description |
Minimum Number of Pay-as-you-go Instances | The minimum number of pay-as-you-go ECS instances required by the scaling group. Default value: 0. If the number of pay-as-you-go ECS instances in the scaling group is less than this value, pay-as-you-go instances are created first. |
Percentage of Pay-as-you-go Instances | The percentage of pay-as-you-go instances among the ECS instances that are automatically created. Default value: 70%. The instances that correspond to the minimum number of pay-as-you-go instances in the scaling group are excluded when this value is calculated. |
Multi-zone Balanced Distribution | Note Evenly distributes ECS instances across the multiple zones specified for the scaling group (that is, the multiple VPC vSwitches specified). You can rebalance the instance distribution across zones. For more information, see Rebalance ECS instances. |
Capacity Planning Policy | The capacity planning policy determines how the scaling group selects available instance types to meet the capacity requirement.
|
Configure Spot Capacity Planning Policy | After this option is enabled, you can specify a separate capacity planning policy for spot instances. |
Spot Capacity Planning Policy | Same as Capacity Planning Policy. |
Lowest Cost Instance Types | Specifies the number of instance types with the lowest price. When spot instances are created, they are evenly distributed across the specified instance types. |
Enable Supplemental Spot Instances | After this feature is enabled, the current spot instance is proactively replaced approximately 5 minutes before it is reclaimed. |
Use Pay-as-you-go Instances to Supplement Spot Capacity | Enabled by default. If the required spot instance capacity cannot be met due to reasons such as price or inventory, enabling this feature allows the scaling group to attempt to create pay-as-you-go instances to meet the current spot instance capacity. |
Replace Pay-as-you-go Instance with Spot Instance | After Use Pay-as-you-go Instances to Supplement Spot Capacity is enabled, the percentage of pay-as-you-go instances in the scaling group may exceed the Percentage of Pay-as-you-go Instances. You can enable this option. After it is enabled, the scaling group attempts to replace pay-as-you-go instances with spot instances. |
Modify a scaling policy by calling an API operation
You can change the scaling policy of a scaling group by calling an API operation. This topic uses the ModifyScalingGroup operation as an example. Different policies require different parameters. The following sections describe the parameters to set for each scaling policy.