A scaling group automatically adjusts resources based on changes in application load to ensure service stability and cost-effectiveness. When a scale-out or scale-in operation is triggered, the system selects appropriate instances to add to or remove from the scaling group based on preset scaling policies. This topic describes the available scaling policies and how to configure them.
Scaling policy descriptions
By default, a scaling group performs scaling activities based on the order of the vSwitches that you configure. This default behavior is known as the Priority policy. You can change the Scaling Policy to use other policies. Auto Scaling provides several preset scaling policies that are described in this section.
You can change this configuration only when the Scaling Group Type is set to ECS. If the Scaling Group Type is ECI, the Scaling Policy defaults to the Priority Policy.
Priority Policy (default policy)
This policy scales instances out or in based on the order of the vSwitches that you define. If an instance cannot be created in the zone of a higher-priority vSwitch, the system automatically attempts to create the instance in the zone of the next-priority vSwitch.
Balanced Distribution Policy
This policy distributes instances evenly across multiple zones to support multi-zone disaster recovery. If the number of ECS instances becomes unbalanced across zones for reasons such as insufficient inventory, you can perform a rebalancing operation to restore the balance. For more information, see Rebalance ECS instances.
Cost Optimization Policy
Use the Cost Optimization Policy when cost is a high priority. When a scaling activity occurs, this policy attempts to create instances in ascending order of their vCPU unit price. If the scaling configuration includes multiple instance types that use the spot billing method, the policy attempts to create spot instances first. If the policy cannot create spot instances, for example, due to insufficient inventory, it automatically attempts to create pay-as-you-go instances. During a scale-in activity, the policy removes the instances with the highest vCPU unit price first.
Custom Combination Policy
This policy lets you customize capacity distribution using a combination of settings. You can use this policy to adjust the ratio of on-demand instances to spot instances, balance capacity across zones, and select instance types in the scaling group.
For configuration instructions, see Configure a scaling policy.
Configure a scaling policy
Change the scaling policy of an existing scaling group
To change the Scaling Policy for 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 Group Management page, find the scaling group for which you want to change the Scaling Policy. In the Actions column, click the Modify button to open the Modify Scaling Group window.
Set Scaling Policy to the desired policy.
If you select the Balanced Distribution Policy, Cost Optimization Policy, or Custom Combination Policy, you must configure the related child configuration items. For more information about the child configuration items, see Child configuration items.
Click the OK button to complete the configuration.
Configure a scaling policy when creating a scaling group
You can also configure the Scaling Policy on the creation page when you create a scaling group, as shown in the following figure.

If you select the Cost Optimization Policy or Custom Combination Policy, you must configure the related child configuration items. For more information about the child configuration items, see Child configuration items.
Child configuration items
If you set the Balanced Distribution Policy, Cost Optimization Policy, or Custom Combination Policy, you must configure additional child configuration items as described in the following tables.
Balanced distribution policy
Configuration Item | Description |
Balance Mode |
|
Enable Auto-rebalance | If you enable this feature, the scaling group automatically detects zone capacity. If the capacity is unbalanced across zones, the group proactively scales out or in between zones to rebalance the capacity. |
Cost optimization policy
Configuration Item | Description |
Minimum Pay-as-you-go Instances | The minimum number of pay-as-you-go ECS instances that the scaling group must contain. The default value is 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 during a scale-out. |
Percentage of Pay-as-you-go Instances | The percentage of pay-as-you-go instances among the automatically created ECS instances. The default value is 70%. This calculation excludes the number of instances specified by Minimum Number Of On-demand Instances In The Group (units). |
Lowest Cost Instance Types | The number of lowest-priced instance types to use for creating instances. The default value is 1. This parameter takes effect only when multiple instance types are specified in the scaling configuration. When creating spot instances, the scaling group distributes the instances evenly across the specified number of lowest-priced instance types. |
Enable Supplemental Spot Instances | If you enable this feature, the scaling group creates a new spot instance to replace a spot instance that is scheduled to be reclaimed. The replacement instance is created approximately 5 minutes before the reclamation. |
Use Pay-as-you-go Instances to Supplement Spot Capacity | This feature is enabled by default. If the required spot instance capacity cannot be met for reasons such as price or inventory, the scaling group attempts to create pay-as-you-go instances to meet the capacity requirement. |
Replace Pay-as-you-go Instance with Spot Instance | After you enable Use Pay-as-you-go Instances to Supplement Spot Capacity, the percentage of on-demand instances in the scaling group may exceed the value specified for Percentage of Pay-as-you-go Instances. If you enable this option, the scaling group attempts to replace the excess on-demand instances with spot instances. |
Custom combination policy
Configuration Item | Description |
Minimum Pay-as-you-go Instances | The minimum number of pay-as-you-go ECS instances that the scaling group must contain. The default value is 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 during a scale-out. |
Percentage of Pay-as-you-go Instances | The percentage of pay-as-you-go instances among the automatically created ECS instances. The default value is 70%. This calculation excludes the number of instances specified by Minimum Number Of On-demand Instances In The Group (units). |
Multi-zone Balanced Distribution | Distributes ECS instances evenly across the zones that are specified for the scaling group. To use multiple zones, you must specify multiple vSwitches. Note You can perform a rebalancing operation to balance the distribution of ECS instances across zones. For more information, see Rebalance ECS instances. |
Capacity Planning Policy | Specifies how the scaling group selects from available instance types to meet capacity requirements.
|
Configure Spot Capacity Planning Policy | If you enable this option, you can specify a separate capacity distribution policy for spot instances. |
Spot Capacity Planning Policy | Same as Capacity Planning Policy. |
Lowest Cost Instance Types | The number of lowest-priced instance types to use. When creating spot instances, the system distributes them evenly across the specified number of instance types. |
Enable Supplemental Spot Instances | If you enable this feature, the system creates a new spot instance to replace an existing spot instance approximately 5 minutes before it is reclaimed. |
Use Pay-as-you-go Instances to Supplement Spot Capacity | This feature is enabled by default. If the required spot instance capacity cannot be met for reasons such as price or inventory, the scaling group attempts to create pay-as-you-go instances to meet the capacity requirement. |
Replace Pay-as-you-go Instance with Spot Instance | After you enable Use Pay-as-you-go Instances to Supplement Spot Capacity, the percentage of on-demand instances in the scaling group may exceed the value specified for Percentage of Pay-as-you-go Instances. If you enable this option, the scaling group attempts to replace the excess on-demand instances with spot instances. |
Change a scaling group's scaling policy using an API
You can call an API operation to change the scaling policy of a scaling group. This section uses the ModifyScalingGroup operation as an example. The required configuration items vary based on the scaling policy, as described in the following sections.