All Products
Search
Document Center

Auto Scaling:Use the Specify Instance Pattern feature in a scaling configuration

Last Updated:Sep 24, 2024

You can specify an instance type for your scaling configuration. If the specified instance type does not have sufficient inventory or is retired, scale-outs may fail. We recommend that you use the Specify Instance Pattern feature. This way, you need to configure only information such as vCPUs and memory size based on your business requirements. Auto Scaling selects an instance type based on your configurations to perform more effective scale-out.

Background information

The Specify Instance Pattern feature automatically selects instance types based on your business requirements. You need to specify the number of vCPUs, memory size, instance family, and maximum acceptable price. Auto Scaling uses one of the selected instance types to create instances during scale-outs. You can also use the Specify Instance Pattern feature to exclude the instance types that you do not want to use.

The Specify Instance Type feature can help you resolve the following issues:

  • If you have one or more instance types in your scaling configuration, but the specified instance types do not have sufficient inventory or are retired, scale-out failures may occur. In this case, you must manually modify your scaling configuration. (For example, set Instance Configuration Mode to Specify Instance Pattern.)

  • If you are unable to determine which instance type is suitable for your business scenario, you can use the Specify Instance Pattern feature.

Usage notes

  • The Specify Instance Pattern feature can be used only if your scaling group resides in a virtual private cloud (VPC).

  • The Specify Instance Pattern feature allows you to specify up to 10 configuration scopes.

    Note

    A configuration scope consists of the number of vCPUs, memory size, instance family level, and maximum acceptable price.

Procedure

The following section provides an example on how to use the Specify Instance Pattern feature and how the configuration takes effect.

  1. Create a scaling group.

    In this example, Minimum Number of Instances is set to 0, Maximum Number of Instances is set to 2, and Network Type is set to VPC. For more information, see Manage scaling groups.

  2. Create and enable a scaling configuration.

    In this example, Billing Method is set to Pay-As-You-Go and Instance Configuration Mode is set to Specify Instance Pattern. For more information, see Create a scaling configuration of the ECS type.

    伸缩配置

    The following table describes the parameters of the Specify Instance Pattern feature.

    Parameter

    Required

    Description

    Example

    vCPU

    Yes

    The number of vCPUs.

    2 vCPU

    Memory

    Yes

    The memory size.

    8 GiB

    Instance Family Level

    Yes

    • Entry Level: Instance types of this level have lower costs, but may not provide stable computing performance in a consistent manner. These instance types are suitable for business scenarios in which the CPU utilization is low. For more information, see Shared instance families.

    • Enterprise Level: Instance types of this level provide stable computing performance and dedicated resources. These instance types are suitable for business scenarios that require high service stability. For more information, see Overview of instance families.

    • Credit Entry Level: Instance types of this level use CPU credits to ensure computing performance. These instance types are suitable for business scenarios in which CPU utilization is usually low but bursts of CPU utilization may occur. For more information, see Overview.

    Enterprise Level

    Max. Acceptable Price

    No

    The maximum acceptable price per hour for an instance type.

    If you set Billing Method to Preemptible Instance, take note of the following items:

    • If the market price of an instance type is higher than the specified maximum acceptable price, instances of the instance type are released.

    • If you set Instance Configuration Mode to Specify Instance Pattern and select the Specify Required Instance Type check box, and the price of the required instance type has an upper limit, you must configure Max. Acceptable Price.

      Important

      For information about how to specify an upper limit on the price of a preemptible instance type, see Instances & Images. Preemptible instances of a preemptible instance type are reclaimed if the maximum acceptable price of the preemptible instance type is greater than the upper limit.

    None

    Specify Required Instance Type

    None

    The required instance type that is specified based on the matching instance types. You can select up to 10 required instance types.

    ecs.g5.large

    In the Preview Instance Type section, you can view the matching instance types that can be used for scale-outs, as shown in the following figure. You can also exclude a specific instance type based on your business requirements. The excluded instance type is not displayed in the Preview Instance Type section.

    Note

    If the required instance type does not have sufficient resources or is retired or if you do not specify the required instance type, Auto Scaling selects the lowest-priced instance type from the matching instance types to create instances.

    查看适配结果

  3. Enable the scaling group.

    Auto Scaling does not automatically trigger a scaling activity if Minimum Number of Instances is set to 0. In this case, the total number of instances in the scaling group is still 0. For more information, see Enable a scaling group.

  4. Create a scaling rule.

    In this example, a simple scaling rule that requires adding two Elastic Compute Service (ECS) instances is created. For information about how to create a scaling rule, see Manage scaling rules.

  5. Execute the scaling rule.

    For more information, see Execute a scaling rule.

    After the scaling rule is executed, you can view the ECS instances that are added. In this example, the required instance type ecs.g5.large can provide resources that are sufficient to create only one ECS instance. The ecs.g6.large instance type has the lowest price. Therefore, Auto Scaling creates one ECS instance of the ecs.g5.large instance type and one ECS instance of the ecs.g6.large instance type. This prevents scale-out failures caused by insufficient resources and improves the success rate of scale-outs.