All Products
Search
Document Center

Auto Scaling:Rebalance the distribution of ECS instances

Last Updated:Oct 25, 2023

If Elastic Compute Service (ECS) instances are unevenly distributed across multiple zones due to insufficient inventory of resources, you can rebalance the distribution of the ECS instances. This topic describes how to rebalance the distribution of ECS instances.

Prerequisites

  • The scaling group is in the Enabled state.

  • The network type of the scaling group is virtual private cloud (VPC).

  • The Multi-Zone Scaling Policy parameter of the scaling group is set to Balanced Distribution Policy.

  • The scaling group is associated with multiple vSwitches and has at least two zones.

Usage notes

  • You need to rebalance the distribution of ECS instances in the scaling group only when the ECS instances are unevenly distributed across the specified zones. You can rebalance the distribution of up to 20 ECS instances each time.

  • During a rebalance activity, Auto Scaling creates new ECS instances before stopping and releasing exiting ECS instances. This ensures that ECS instances are evenly distributed across the specified zones. The rebalance activity does not affect the performance or availability of application programs.

  • During a rebalance activity, if the number of ECS instances in the scaling group is near or reaches the maximum number of instances that can be contained in the scaling group and the rebalance activity needs to continue, Auto Scaling allows the number of ECS instances to temporarily exceed the maximum number by a margin of 10%. The extension lasts until the rebalance of the ECS instances is complete. Typically, the extension lasts one to six minutes.

    Note

    If 10% of the maximum number is not an integer, the number is rounded up. For example, if the maximum number of ECS instances that can be contained in a scaling group is 15, Auto Scaling allows the number of ECS instances to temporarily exceed the maximum number by 2 during a rebalance activity. This is because 10% of the maximum number is 1.5, which is not an integer and therefore rounded up to 2.

Procedure

  1. Log on to the Auto Scaling console.
  2. In the left-side navigation pane, click Scaling Groups.
  3. In the top navigation bar, select the region where Auto Scaling is activated.
  4. Find a scaling group and use one of the following methods to go to the scaling group details page:
    • Click the ID of the scaling group in the Scaling Group Name/ID column.
    • Click Details in the Actions column.
  5. In the upper part of the scaling group details page, click the Instances tab.
  6. On the Auto Created tab, click Rebalance Distribution.

  7. On the Rebalance the Distribution of ECS Instances in a Scaling Group Across Multiple Zones page, confirm the related items, and then click Confirm Execution.

View the result

After a rebalance activity is complete, you can view the newly created ECS instances on the Instances tab. The newly created ECS instances will enter the In Service state and the existing ECS instances will be released after a short period of time. This ensures that the total number of ECS instances in the scaling group remains unchanged after the rebalance activity.