If the ECS instances are not evenly distributed across zones due to insufficient resources, you can use the Rebalance Distribution feature to evenly distribute the ECS instances.

Prerequisites

  • The network type of the scaling group must be VPC.
  • The multi-zone scaling policy of the scaling group must be Balanced Distribution Policy.
  • The scaling group must be associated with multiple VSwitches that are distributed across at least two zones.

Background information

A maximum of 20 ECS instances can be replaced in one rebalancing activity. When the rebalancing activity is executed, Auto Scaling first creates new ECS instances, and then stops and releases existing ECS instances to ensure that the ECS instances are evenly distributed across multiple zones. This does not affect the application performance or availability.

Auto Scaling allows the number of ECS instances to exceed 10% of the maximum number of instances for a short period of time. This occurs if the number of ECS instances in a scaling group approaches or reaches the maximum number of instances, but you must continue the balancing activity. If 10% of the maximum number of instances in the scaling group is not an integer, the decimal can be rounded up to one. The situation may last for a while until the distribution of ECS instances is balanced. It typically takes between one and six minutes.

For example, the maximum number of instances in a scaling group is 15. A value of 10% indicates that the number of instances is 1.5. The number of instances that a scaling group can exceed for a short period of time is 2.

Procedure

  1. Log on to the Auto Scaling console.
  2. In the top navigation bar, select a region.
  3. You can use either of the following methods to open the details page of a scaling group.
    • In the Scaling Group Name/ID column, click a scaling group name.
    • Click Manage in the Actions column corresponding to a scaling group.
  4. In the left-side navigation pane, click ECS Instances.
  5. In the upper-right corner of the page, click Rebalance Distribution.
  6. Read the confirmation items and then click Confirm Execution.

Result

The message The rebalancing task has been assigned appears in the upper-right corner of the page. The newly created instances are displayed in the instance list. After a period of time, the newly created instances enter the InService state, and some existing ECS instances are released. However, the total number of ECS instances in the scaling group remains unchanged.