All Products
Search
Document Center

Auto Scaling:Expected number of instances

Last Updated:Apr 01, 2026

Without the Expected Number of Instances feature, a scaling group can only run one scaling activity at a time — all other requests are rejected while one is in progress, and any failed activity requires manual retry. Enable the Expected Number of Instances feature to remove both constraints: Auto Scaling maintains the instance count automatically, retries failures without intervention, and supports parallel scaling activities.

When to use expected number of instances

Enable this feature when you need any of the following:

  • Automatic recovery from failures: Auto Scaling retries failed scaling activities automatically, without manual intervention.

  • Parallel scaling activities: Multiple compatible scaling activities can run concurrently. Without this feature, only one activity runs at a time, and all others are rejected during that period.

  • Continuous instance reconciliation: Auto Scaling continuously checks the actual instance count against the expected count and adjusts automatically.

Key concepts

ConceptDescription
Steady-state instanceAn instance in the In Service, Protected, or Standby state in a scaling group.
Parallel scaling activityA scaling activity that can run concurrently with other ongoing activities. Triggered by: manually executing a scaling rule, using a scheduled task to execute a scaling rule, manually adding or removing instances, or system checks (expected count, health status, min/max count).
Non-parallel scaling activityA scaling activity that cannot run concurrently with other ongoing activities. Triggered by: executing a scaling rule via an event-triggered task, manually running a rebalancing task on the Instances tab, or automatic spot instance supplementation (requires Scaling Policy set to Cost Optimization Policy with Enable Supplemental Spot Instances turned on).

Limits

  • A scaling group cannot have both parallel and non-parallel scaling activities in progress at the same time.

  • The Expected Number of Instances value must fall within the Minimum Number of Instances to Maximum Number of Instances range.

Enable or disable expected number of instances

To enable: When creating or modifying a scaling group, set the Expected Number of Instances parameter. For details, see Manage scaling groups. After enabling, you can update the expected count at any time to match your business needs.

To disable: Call the ModifyScalingGroup API operation.

How instance count changes

The expected count and the actual instance count change differently depending on how a scaling activity is triggered.

Parallel scaling activities

TriggerEffect on instancesEffect on expected countFormula
Manually execute a scaling ruleNot immediately created or removed. Auto Scaling waits for the next expected-count check.Changes immediately.Steady-state count ± scaled count
Scheduled task executes a scaling ruleNot immediately created or removed. Auto Scaling waits for the next expected-count check.Changes immediately.Steady-state count ± scaled count
Manually add instancesAdded immediately.Increases by the number of instances added.Current expected count + added count
Manually remove instancesRemoved immediately.Decreases by the number of instances removed.Current expected count − removed count
Check min/max countNo automatic change.Must be updated manually if the new min/max would make the current expected count out of range.Manually specified
Health check detects unhealthy instancesUnhealthy instances removed immediately.Unchanged. Auto Scaling detects the gap and creates instances to compensate.Unchanged
Expected-count check detects a gapInstances added or removed immediately to close the gap.Unchanged.Unchanged

Non-parallel scaling activities

TriggerEffect on instancesEffect on expected countFormula
Event-triggered task executes a scaling ruleAdded or removed immediately.Changes immediately.Steady-state count ± scaled count
Note: For detailed examples of how to specify an expected count, see Examples of parallel scaling activities and Examples of non-parallel scaling activities.

Comparison: with vs. without expected number of instances

ItemWith expected number of instancesWithout expected number of instances
MaintenanceAutomatic. Auto Scaling retries failed activities automatically.Manual. You must retry failed activities yourself.
Manual scaling rules and scheduled tasksDo not immediately trigger scaling. Auto Scaling updates the expected count and reconciles during the next check.Immediately trigger a scaling activity.
Manual add/remove, event-triggered tasksImmediately trigger scaling and update the expected count.Immediately trigger a scaling activity.
Parallel scaling activitiesSupported.Not supported. Only one activity runs at a time; all others are rejected during that period.

Examples of parallel scaling activities

After you set an expected number of instances, Auto Scaling can run compatible scaling activities in parallel.

Example 1: Two scaling rules executed consecutively

Starting state:

  • Expected count: 3

  • Steady-state instances: 3

  • add3 rule: creates 3 ECS instances

  • add1 rule: creates 1 ECS instance

Execute the add3 rule, then immediately execute the add1 rule.

  • After executing add3: the expected count changes from 3 to 6 (steady-state 3 + 3 = 6).

  • After executing add1: the expected count changes from 6 to 4 (steady-state 3 + 1 = 4).

  • Both activities run in parallel. When complete, the steady-state instance count is 4.

Example 1

Example 2: Scaling rule and manual instance addition run simultaneously

Starting state:

  • Expected count: 3

  • Steady-state instances: 3

  • add1 rule: creates 1 ECS instance

Execute the add1 rule and manually add 1 existing ECS instance at the same time.

  • After executing add1: the expected count changes from 3 to 4 (steady-state 3 + 1 = 4).

  • After adding the instance manually: the expected count changes from 4 to 5 (current expected 4 + 1 = 5).

  • Both activities run in parallel. When complete, the steady-state instance count is 5.

Example 2

Examples of non-parallel scaling activities

When a non-parallel scaling activity is in progress, parallel scaling activity requests are rejected.

Starting state:

  • Expected count: 1

  • Steady-state instances: 1

  • Event-triggered task rule: creates 3 ECS instances

  • add1 rule: creates 1 ECS instance

Trigger the event-triggered task, then immediately execute the add1 rule.

  • The event-triggered task starts a non-parallel scaling activity and changes the expected count from 1 to 4 (steady-state 1 + 3 = 4).

  • The request to execute add1 is rejected because a non-parallel activity is already in progress.

  • The expected count stays at 4. When the non-parallel activity completes, the steady-state instance count is 4 (3 instances created).

Non-parallel activity example

What's next