All Products
Search
Document Center

Auto Scaling:Usage process

Last Updated:Jan 15, 2025

This topic describes how to use Auto Scaling API operations to create a complete auto-scaling solution, including scheduled, dynamic, custom, and fixed-mode scaling.

Flowchart

To implement a comprehensive auto-scaling solution, follow the steps outlined in the following flowchart. Completing only the first three steps results in a basic auto-scaling solution.

image

Process description

  1. Create a scaling group (CreateScalingGroup): In this step, specify the minimum and maximum numbers of instances for the scaling group, along with the Server Load Balancer (SLB) and ApsaraDB RDS instances to attach to the scaling group. For more information, see Creates a scaling group.

  2. Create a scaling configuration (CreateScalingConfiguration): In this step, you can specify Elastic Compute Service (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 scaling configuration ID from 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 desired type to meet your business requirements. For example, you can create a simple rule to add N ECS instances. For more information, see Creates a scaling rule.

  5. Create an auto-scaling task to automatically execute a scaling rule. You can create the following types of auto-scaling tasks:

    • Create a scheduled task (CreateScheduledTask): You can create a scheduled task to specify when automatic scaling occurs. For example, you can create a scheduled task that executes 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 automatically manage ECS instances within the scaling group based on CloudMonitor metrics. For example, you can create an event-triggered task to automatically scale ECS instances when CPU utilization hits or exceeds 80%. For more information, see Creates an event-triggered task.