All Products
Search
Document Center

Auto Scaling:Process

Last Updated:Oct 27, 2023

This topic describes how to call Auto Scaling API operations to create a comprehensive auto-scaling solution that supports scheduled scaling, dynamic scaling, custom scaling, and fixed-mode scaling.

Flowchart

To create a comprehensive auto-scaling solution, you must perform the steps described in the following process. If you complete only the first three steps, you get a simple auto-scaling solution.

image

Description

  1. Create a scaling group (CreateScalingGroup): In this step, you can specify the minimum number of instances that must be contained in the scaling group, the maximum number of instances that can be contained in the scaling group, and the Server Load Balancer (SLB) and ApsaraDB RDS instances with which you want to associate the scaling group. For more information, see Creates a scaling group.

  2. Create a scaling configuration (CreateScalingConfiguration): In this step, you can specify ECS instance attributes, such as the image ID and instance type. For more information, see Creates a scaling configuration.

  3. Enable the scaling group (EnableScalingGroup): In this step, you can use the ID of the scaling configuration that was created in the previous step to enable the scaling group. For more information, see Enables a scaling group.

  4. Create a scaling rule (CreateScalingRule): In this step, you can create a scaling rule of the specific type to meet your business requirements. For example, you can create a simple scaling rule that is used to add N ECS instances. For more information, see Creates a scaling rule.

  5. Create an auto-scaling task. You can trigger the auto-scaling task to execute the scaling rule that was created in the previous step to perform automatic scaling. You can create the following types of auto-scaling tasks:

    • Create a scheduled task (CreateScheduledTask): You can create a scheduled task to specify a point in time at which automatic scaling is performed. For example, you can create a scheduled task that triggers a scaling rule at 12:00:00. For more information, see Creates a scheduled task.

    • Create an event-triggered task (CreateAlarm): You can create an event-triggered task to dynamically manage the ECS instances in the scaling group. For example, if you monitor the CPU utilization metric and the trigger threshold is CPU utilization ≥ 80%, the event-triggered task is triggered to perform automatic scaling when the CPU utilization of the ECS instances reaches or exceeds 80%. For more information, see Creates an event-triggered task.