All Products
Search
Document Center

Auto Scaling:Use process

Last Updated:Feb 07, 2024

This topic describes how to use Auto Scaling. You can refer to this topic to quickly get started with Auto Scaling.

Process overview

Note

If you want to use the Auto Scaling API to manage Auto Scaling resources, refer to API quick start.

image

In the preceding process, Create event-triggered tasks and Create scheduled tasks are optional steps. You can decide whether to create event-triggered tasks and scheduled tasks based on your business requirements.

Tutorial

You can watch the following video to learn how to get started with Auto Scaling.

Procedure

  1. Create a scaling group.

    A scaling group is a basic management unit in Auto Scaling. You can use a scaling group to manage Elastic Compute Service (ECS) instances or elastic container instances that are required by your business. The ECS instances or elastic container instances that are contained in a scaling group can be used only in similar business scenarios. You can associate multiple Server Load Balancer (SLB) instances and ApsaraDB RDS instances with a scaling group. For more information, see Overview.

    Note

    After you associate SLB instances and ApsaraDB RDS instances with a scaling group, the ECS instances or elastic container instances that are added to the scaling group are attached to the SLB instances as backend servers, and the private IP addresses of the instances are added to the IP address whitelists of the ApsaraDB RDS instances.

  2. Create a scaling configuration of the ECS type or create a scaling configuration of the Elastic Container Instance type.

    A scaling configuration is a template that is used by Auto Scaling to automatically create ECS instances or elastic container instances. You can create multiple scaling configurations for a scaling group. However, you can enable only one scaling configuration for the scaling group at a time. For more information, see Overview.

    Note

    If you set the Instance Configuration Source parameter to Launch Templates or Select Existing Instance when you create a scaling group, you can enable the scaling group without creating a scaling configuration.

  3. Enable the scaling group.

    The first time you create a scaling configuration, a message that prompts you to enable the scaling group appears. You can also choose to enable the scaling group on the Scaling Groups page.

  4. Create scaling rules.

    A scaling rule is used to specify information such as the number of ECS instances or elastic container instances that can be scaled in each adjustment or efficiently adjust the minimum and maximum numbers of instances in a scaling group. You can create scaling rules of different types based on your business requirements. For more information, see Overview.

  5. Create auto-scaling tasks.

    After you create scaling rules, you can create auto-scaling tasks to automatically execute the scaling rules. Auto Scaling supports the following types of auto-scaling tasks:

    • Scheduled tasks

      If your business has specific patterns and you can predict the peak hours, you can create scheduled tasks to automatically scale instances. You can specify a recurrence period for scheduled tasks to automatically repeat task execution within the specified time period. For more information, see Overview.

    • Event-triggered tasks

      If you want to scale instances based on the metrics of ECS instances or elastic container instances, you can create event-triggered tasks. You can use CloudMonitor metric-based event-triggered tasks to dynamically manage ECS instances or elastic container instances in your scaling group. For more information, see Overview.

References

  • The first time you use Auto Scaling as a Resource Access Management (RAM) user, you must create the AliyunServiceRoleForAutoScaling service-linked role. For more information, see Manage the service-linked role for Auto Scaling.

  • If you run your business on ECS instances, you can use Auto Scaling to quickly scale ECS instances. For more information, see Quickly scale ECS instances.

  • If you run your business on elastic container instances, you can use Auto Scaling to quickly scale elastic container instances. For more information, see Scale elastic container instances.