Auto Scaling is a service that dynamically adjusts the number of instances based on your business requirements and scaling policies. You can use Auto Scaling to scale Elastic Compute Service (ECS) instances or elastic container instances. To ensure that sufficient computing resources are available, you can use Auto Scaling to add instances of the specified type during peak hours. To prevent waste of resources and reduce costs, you can use Auto Scaling to remove instances of the specified type during off-peak hours. Auto Scaling is suitable for applications on which workloads fluctuate and applications on which workloads are stable.

The following video shows how to use Auto Scaling to scale ECS instances.

Benefits

If workloads fluctuate on your application, you can use Auto Scaling to automatically change the number of instances of the specified type to meet your business requirements. The following table describes the benefits that are provided by Auto Scaling.

Benefit Description
Automation
  • Auto Scaling can automatically add instances of the specified type during a scale-out activity, and then attach the instances to Server Load Balancer (SLB) instances. If your scaling group consists of ECS instances, Auto Scaling can also attach the ECS instances to ApsaraDB RDS instances.
  • Auto Scaling can automatically remove instances of the specified type during a scale-in activity, and then detach the instances from SLB instances. If your scaling group consists of ECS instances, Auto Scaling can also detach the ECS instances from ApsaraDB RDS instances.
Cost-effectiveness If you use Auto Scaling, you do not need to invest a lot of manpower to adjust the number of instances or prepare instances before traffic spikes occur. With Auto Scaling, you have no idle resources. Auto Scaling automatically scales instances to help you reduce resource costs.
High availability You can use Auto Scaling to perform health checks on ECS instances or elastic container instances to ensure high availability of your service. Auto Scaling can automatically check the health status of your instances. If the system determines that an instance is unhealthy, Auto Scaling automatically adds an instance to replace the unhealthy instance. The new instance and the unhealthy instance must be of the same type.
Flexibility and intelligence
  • You can use Auto Scaling to scale ECS instances or elastic container instances.
  • Auto Scaling provides multiple scaling modes to help you meet the requirements of complex business scenarios. The scaling modes include the fixed-number mode, health mode, scheduled mode, dynamic mode, and custom mode. In dynamic mode, Auto Scaling is integrated into CloudMonitor by using API operations.
  • Auto Scaling allows you to select a template to create instances based on your business requirements. This helps improve the success rate of scale-out.
  • Auto Scaling also supports multiple scaling policies that you can use in different business scenarios.
Easy audit Auto Scaling logs the details of each scaling activity and monitors scaling groups. This can help you identify and resolve issues in an effective manner.

For more information, see Benefits.

Features

Auto Scaling can automatically scale ECS instances or elastic container instances based on your business requirements. The following table describes the items that you can configure in Auto Scaling.

Item Description
Scaling group A scaling group consists of instances of the same type that you can use for similar business scenarios. You can configure a scaling group to specify the type of instance to which computing resources are allocated. You can also specify the instance configuration source, the maximum number and minimum number of instances, and the Classic Load Balancer (CLB) instance or the Application Load Balancer (ALB) server group with which you want to associate the scaling group. If you want to use Auto Scaling in multiple scenarios, you can create more than one scaling group. Auto Scaling automatically allocates computing resources to each scaling group based on your configurations.
Instance configuration source An instance configuration source specifies information about the template that is used to manage your ECS instances or elastic container instances. Auto Scaling uses the template of the ECS type to create ECS instances and the template of the Elastic Container Instance type to create elastic container instances during scale-out activities.
Scaling rule A scaling rule is used to trigger a scaling activity. For example, you can create a scaling rule that triggers a scale-out activity in which an ECS instance or elastic container instance is added. You can manually run scaling rules. You can create event-triggered tasks or scheduled tasks to automatically run scaling rules. You can also create scaling rules to automatically change the maximum or minimum number of instances that are allowed in your scaling group.
Event-triggered task Auto Scaling is integrated into CloudMonitor to monitor the metrics of your scaling group in real time. If the monitored metrics reach the specified thresholds, the corresponding scaling rules are triggered.
Scheduled task You can create scheduled tasks to automatically run scaling rules at the specified points in time.
Auto Scaling can work only after you configure and enable a scaling group and specify the instance configuration source for the scaling group. You can specify other configurations based on your business requirements. The following figure shows how to use Auto Scaling.Workflow

Auto Scaling also provides the following features to meet diverse requirements:

  • If a scaling activity succeeds, fails, or is rejected, Auto Scaling sends notifications by using the methods that are described in the following table.
    Feature Description
    Message notification Auto Scaling sends notifications by using text messages, internal messages, and emails.
    Event notification Auto Scaling automatically sends notifications to CloudMonitor or Message Service (MNS). If you use MNS, notifications are sent to the specified MNS topic or MNS queue. You are charged when you use MNS. For more information about the pricing of MNS, see Pricing.
  • To help you manage instances in a scaling group, Auto Scaling also supports the features that are described in the following table.
    Feature Description
    Lifecycle hook A lifecycle hook is used to manage the lifecycle of ECS instances or elastic container instances in a scaling group. During a scaling activity, a lifecycle hook can be triggered to switch the states of ECS instances or elastic container instances in your scaling group to Pending. This way, you can perform custom operations until the lifecycle hook times out.
    Manually add an ECS instance to a scaling group You can manually add ECS instances or elastic container instances to a scaling group, or remove ECS instances or elastic container instances from a scaling group.
    Rolling update If your scaling group consists of ECS instances, you can use the rolling update feature. You can create rolling update tasks to update the configurations of multiple ECS instances at a time. For example, you can update images, run scripts, or install Operation Orchestration Service (OOS) packages on ECS instances that are in the In Service state.

For more information, see How Auto Scaling works.

Scenarios

Auto Scaling provides a variety of scaling features that can be used in the following business scenarios:

  • Scenarios in which workload fluctuations can be predicted. For example, a video production company whose workload fluctuations can be predicted uses Auto Scaling to create scheduled tasks. Auto Scaling automatically adds an ECS instance or elastic container instance to help the company handle traffic spikes that occur at 20:00:00 each Friday.
  • Scenarios in which workload fluctuations cannot be predicted. For example, a video production company whose workload fluctuations cannot be predicted uses Auto Scaling to create event-triggered tasks and monitor the CPU utilization of instances. If the CPU utilization exceeds 60%, Auto Scaling automatically adds an ECS instance or elastic container instance to help the company handle traffic spikes.

For more information, see Scenarios.

Billing rules

Auto Scaling is free of charge. However, you are charged for the resources of other services that you use, including ECS, Elastic Container Instance, ApsaraDB RDS, SLB, and MNS. For information about the pricing of these resources, see Billing.

How to use Auto Scaling

  • Auto Scaling console: a web page that supports interactive operations.
  • API: a remote procedure call (RPC) API that supports GET and POST requests. For more information, see List of operations by function. If you want to call the Auto Scaling API, use the following common developer tools:
    • Alibaba Cloud CLI: a flexible and scalable management tool based on Alibaba Cloud APIs. You can use CLI to encapsulate Alibaba Cloud native APIs and develop custom features.
    • OpenAPI Explorer: a tool that allows you to retrieve API operations, call API operations, and dynamically generate SDK sample code.

Related services