A scaling group contains a group of Elastic Compute Service (ECS) instances or elastic container instances that you can use for similar business scenarios. If you have multiple business scenarios, you can create multiple scaling groups. Auto Scaling automatically adjusts the number of instances in the scaling groups based on your configurations to meet your business requirements.
Compare the features of scaling groups of different types
If you set Type to ECS when you create a scaling group, the scaling group can contain a group of ECS instances. If you set Type to ECI when you create a scaling group, the scaling group can contain a group of elastic container instances. Different types of scaling groups provide different features. The following table compares the features of scaling groups that contain ECS instances and scaling groups that contain elastic container instances.
|Feature category||Feature||ECS||Elastic Container Instance|
|Scaling group||Basic configurations||Supported||Supported|
|Association with Server Load Balancer (SLB) instances||Supported||Supported|
|Association with ApsaraDB RDS instances||Supported||Not supported|
|Instance configuration source||Launch template||Supported||Not supported|
|Image update||Supported||Not supported|
|Instance list||Automatic creation of instances||Supported||Supported|
|Manual addition of instances||Supported||Not supported|
|Scaling rule and scaling activity||Scaling rule||Supported||Supported|
|Scaling group monitoring||Supported||Supported|
|Lifecycle hook||Supported||Not supported|
|Rolling update||Supported||Not supported|
Scaling group status
The following table describes the possible states of a scaling group.
|Enabling||Inactive||Enable a scaling group|
|Disabling||Inactive||Disable a scaling group|
|Deleting||Deleting||Delete a scaling group|
Instance configuration source
When you create a scaling group, you must specify an instance configuration source. You can set Instance Configuration Source to Launch Templates, Select Existing Instance, or Create from Scratch. The Launch Templates setting is available only for ECS-type scaling groups. The Select Existing Instance setting takes effect only after a scaling configuration is created. If you set Instance Configuration Source to Create from Scratch, you need to manually create a scaling configuration.
A scaling group can contain only one active scaling configuration source. For example, if you activate another scaling configuration in a scaling group for which an active scaling configuration is applied, the current launch template or the scaling configuration exits the Active state. For more information, see Overview of instance configuration sources.
Scaling rule and scaling activity
After you create a scaling group, you need to create scaling rules to scale instances in the scaling group.
- Scaling rule: You can create scaling rules to trigger scaling activities in a scaling
group or to configure the maximum and minimum numbers of instances in the scaling
group. For more information, see Overview.
Auto Scaling scales ECS instances in a scaling group based on scaling rules and the maximum, minimum, or expected number of ECS instances specified for the scaling group. For example, if you create a scaling rule that specifies to adjust the number of instances in your scaling group to 50, and the maximum number of ECS instances allowed in your scaling group is 45, your scaling group contains only 45 ECS instances after the scaling rule is executed. For more information about the expected number of instances feature, see Expected number of instances.
Scaling rules can be executed by using the following methods:
- Scaling activity: A scaling activity is triggered when a scaling rule is executed
or when you manually add or remove ECS instances. For more information, see Overview.
The following rules apply to scaling activities:
- An ongoing scaling activity cannot be terminated. For example, if a scaling activity is being executed to create 20 ECS instances but only 5 instances have been created, you cannot terminate the scaling activity.
- If some ECS instances fail to be added to a scaling group during a scaling activity, Auto Scaling considers that the scaling activity is complete. Auto Scaling rolls back only the ECS instances that fail to be added. For example, if a scaling group contains 20 ECS instances and 19 instances are added as the backend servers of the SLB instance that is associated with the scaling group, only the ECS instance that fails to be added is automatically released.
- Auto Scaling uses Resource Access Management (RAM) to call ECS API operations to create ECS instances. When ECS instances are rolled back, you must continue to pay for the ECS instances until they are released.
- Scaling activities are affected by the cooldown time feature. During the cooldown time, Auto Scaling rejects all scaling activities triggered by event-triggered tasks. However, when you manually execute a scaling rule, or a scheduled task starts to be executed at the specified point in time, Auto Scaling executes the scaling activity immediately without waiting for the cooldown time to expire. For more information about the cooldown time feature, see Cooldown time.
- The cooldown time starts after the last ECS instance or elastic container instance is added to or removed from a scaling group during a scaling activity.