Rebalance the distribution of ECS instances
When resource inventory in a zone is temporarily exhausted, Auto Scaling may create new ECS instances in other zones to meet capacity demands, leaving your scaling group unevenly distributed across zones. Use the rebalance operation to restore even distribution without interrupting application availability.
Prerequisites
Before you begin, ensure that you have:
-
A scaling group in the Enable state
-
A scaling group with the network type set to VPC
-
The Multi-Zone Scaling Policy of the scaling group set to Distribution Balancing
-
A scaling group associated with multiple vSwitches that spans at least two zones
How it works
A rebalance operation runs in two phases to avoid service disruption:
-
Scale out: Auto Scaling creates new ECS instances in under-represented zones.
-
Scale in: After the new instances enter the In Service state, Auto Scaling releases the excess instances from over-represented zones.
Because new instances are created before existing ones are released, the total instance count stays stable throughout the operation and application availability is not affected.
Temporary capacity overflow: If the scaling group is at or near its maximum instance count when a rebalance starts, Auto Scaling temporarily allows the count to exceed the maximum by up to 10%, rounded up. This overflow lasts one to six minutes until the rebalance completes.
If 10% of the maximum is not a whole number, the allowed overflow is rounded up. For example, if the maximum is 15 instances, the overflow is rounded up to 2 (10% of 15 = 1.5, rounded up to 2), allowing up to 17 instances temporarily.
Limits
-
Rebalance only when ECS instances are unevenly distributed across the specified zones.
-
Each rebalance operation can rebalance up to 20 ECS instances.
Rebalance instance distribution
-
Log on to the Auto Scaling console.
-
Log on to the Auto Scaling console.
-
In the left-side navigation pane, click Scaling Groups.
-
In the top navigation bar, select a region.
-
Find the target scaling group and open its details page using either of the following methods:
-
Click the ID of the scaling group in the Scaling Group Name/ID column.
-
Click Details in the Actions column.
-
-
In the upper part of the details page, click the Instance Management tab.
-
In the Auto Created list, click Rebalance Distribution.
-
On the Rebalance the Distribution of ECS Instances in a Scaling Group Across Multiple Zones page, review the listed items and click Submit.
Verify the result
After the rebalance completes, go to the Instances tab to confirm the result:
-
Newly created ECS instances appear in the In Service state.
-
Previously over-represented instances are released after a short period.
-
The total number of ECS instances in the scaling group remains unchanged.