Configure a scaling configuration with Specify Instance Pattern

Updated at:
Copy as MD

Specifying one or more instance types in a scaling configuration can cause scale-out failures if they have insufficient inventory or are retired. To prevent this, use the Specify Instance Pattern mode. This mode lets you define requirements, such as vCPU and memory, allowing Auto Scaling to automatically select matching instance types for scale-outs. This approach significantly increases the scale-out success rate.

Background information

The Specify Instance Pattern feature automatically selects instance types that match your requirements. You define attributes such as the vCPU count, memory size, instance family level, and a maximum acceptable price. The system then finds all instance types that match your criteria. During a scaling activity, the scaling group can launch any of the matching instance types. You can also exclude specific instance types from the matched results.

Using Specify Instance Pattern helps you avoid the following issues:

  • If your scaling configuration specifies one or more instance types, scale-outs can fail when those types are retired or have insufficient inventory. You must then manually modify the scaling configuration, for example, by changing the Instance Configuration Mode to the Specify Instance Pattern mode.

  • If you are unsure which instance types to choose, use Specify Instance Pattern to configure your scaling configuration.

Limitations

  • The Specify Instance Pattern mode is supported only when the scaling group's network type is VPC.

  • Specify Instance Pattern supports up to 10 configuration scopes.

    Note

    A configuration scope includes vCPU count, memory size, instance family level, and a maximum acceptable price.

Procedure

This topic provides an example of creating a scaling configuration in Specify Instance Pattern mode and demonstrates its effect.

  1. Create a scaling group.

    In this example, the minimum number of instances in the scaling group is 0, the maximum is 2, and the network type is VPC. For more information, see Manage scaling groups.

  2. Create and enable a scaling configuration.

    In this example, Billing Method is Pay-as-you-go, and Instance Configuration Mode is Specify Instance Pattern. For more information, see Create a scaling configuration (ECS instances).

    The following table describes the parameters for the Specify Instance Pattern mode:

    Parameter

    Required

    Description

    Example

    vCPU

    Yes

    The number of vCPUs for the instance.

    2 vCPU

    Memory

    Yes

    The memory size of the instance.

    8 GiB

    Instance Family Level

    Yes

    • Entry Level: Shared instance types that offer lower costs but do not guarantee stable computing performance. This level is suitable for workloads with low CPU utilization. For more information, see Shared instance families.

    • Enterprise Level: Provides stable performance and dedicated resources. This level is suitable for workloads that require high stability. For more information, see Instance families.

    • Credit Entry Level: Shared instance types that use CPU credits to ensure computing performance. This level is suitable for workloads with low baseline CPU utilization and occasional performance bursts. For more information, see Overview of burstable performance instances.

    Enterprise Level

    Max Acceptable Price

    No

    The maximum hourly price for an instance.

    If the billing method for the instance is Spot Instance, take note of the following:

    • If the market price of the instance exceeds your maximum acceptable price, the instance is released.

    • If you use Specify Instance Pattern and also select Targeted Required Instance Types, and the selected instance type has a per-instance price cap, you must configure this parameter.

      Important

      For more information about how to set a per-instance price cap for a Spot Instance, see Instances and Images. If the maximum acceptable price exceeds the per-instance price cap, Spot Instances that are created by the scaling group are reclaimed.

    Not configured

    Specify Instance Types that Must Be Included

    No

    You can require specific instance types from the matching list. You can select up to 10 required instance types.

    ecs.g5.large

    The Preview Instance Types area displays all instance types that Auto Scaling can select during a scale-out. You can exclude any instance types as needed. Excluded instance types are removed from the candidate pool for scale-outs.

    Note

    If your required instance types have insufficient inventory or are retired, or if you do not specify any required instance types, Auto Scaling selects the lowest-priced available instance type from the matching pool to create ECS instances.

  3. Enable the scaling group.

    Because the minimum number of instances for the scaling group is 0, Auto Scaling does not automatically trigger a scaling activity. The total number of instances in the scaling group remains 0. For more information, see Enable a scaling group.

  4. Create a scaling rule.

    In this example, you create a simple scaling rule to add two ECS instances. For more information, see Manage scaling rules.

  5. Execute the scaling rule.

    For more information, see Execute a scaling rule.

    After the rule is executed, you can view the scaled-out ECS instances. In this example, assume that inventory is available for only one ecs.g5.large instance. Auto Scaling automatically selects from other matching instance types to fulfill the request. Besides launching one ecs.g5.large instance, Auto Scaling launches another instance of the next lowest-priced type, such as ecs.g6.large. This prevents scale-out failures from insufficient inventory of a specific instance type and significantly improves the success rate of scaling activities.