Auto scaling is an important O&M capability for distributed application management. Auto scaling checks the status of each instance in an application and implements dynamic scale-outs and scale-ins based on your business requirements. This ensures service quality and improves application availability.
Applications such as the Internet and game applications are prone to sudden traffic surges during promotional activities. The difficulty in balance between service-level agreements (SLAs) and resource costs may cause system issues, such as slow responses and breakdowns. EDAS inherits the traffic surge management technology that is used by Alibaba to cope with Double 11, and provides the second-level auto scaling feature. This ensures SLA compliance and reduces the costs of server retention. Auto scaling is widely used in the industries, such as the Internet, games, and social networking platforms.
Auto scaling is applicable to applications that are created in ECS Clusters. In a single-instance environment, auto scaling ensures that one instance is always running in the environment. In an environment where the traffic fluctuates, you can specify a range for the number of running instances for auto scaling. Then, EDAS adds or removes instances based on the configured load rules.
- CPU: the CPU utilization. This is a percentage value.
- RT: the response time to a request. The unit is milliseconds.
- Load: the load on the application instance. This is a positive integer.
Auto scaling includes auto scale-outs and auto scale-ins. You can configure different rules for them. The following example shows how to configure a scale-out rule.
- When you configure both the scale-in and scale-out rules, make sure that the metric values of the scale-in rules are not greater than those of the scale-out rules. Otherwise, an error message appears when you click Save.
- The instances that are created based on elastic resources are first released during a scale-in operation.
- Log on to the EDAS console.
- In the left-side navigation pane, click Applications. In the top navigation bar, select a region. In the upper part of the page, select a namespace. On the Applications page, click the name of the desired application.
- In the left-side navigation pane of the application details page, click Auto Scaling.
- In the upper-right corner of the Scale-out Rule section, turn on the switch to enable the scale-out rule.
- Configure the scale-out rule parameters. In the lower-left corner of the Auto Scaling page, click Save.
- Configure Trigger Metrics to specify the thresholds for the CPU, RT, and Load metrics. When one or more metrics exceed the specified thresholds, a scale-out is triggered.
- Select one of the following values from the Trigger Conditions drop-down list:
- Any One of the Metrics: A scale-out is triggered when one of the configured metrics exceeds the specified threshold.
- All Metrics: A scale-out is triggered only when all the configured metrics exceed the specified thresholds.
- Set Last for More Than to specify a duration in which the metric continuously exceeds the threshold. The unit is minute. Within the duration, if the average value of a metric per minute continuously exceeds the specified threshold, an auto scale-out is triggered. You can configure the duration based on the sensitivity of the cluster service capabilities.
- Configure Application Source:
- Existing Resources: During an automatic scale-out process, the system selects a specified number of
idle ECS instances from the cluster where the application is deployed, and adds them
to the application.
Note If the number of existing ECS instances in the cluster cannot meet the scale-out requirement, EDAS performs the scale-out operation based on the number of existing instances.
- Elastic Resources: An instance is purchased based on an existing instance specification or an instance
launch template. Then, the purchased instance is automatically imported to the cluster
for the scale-out of the application.
Parameter Description Creation Method
- Purchase Based on Existing Instance Specifications: An instance is purchased based on one of the existing specifications of the instances in the cluster.
- Purchase Based on Instance Launch Template: An instance is purchased based on the instance launch template that you have created in the ECS console.
Template host / launch template Select an existing instance specification or an instance launch template as the template for purchasing the instance. Password If you select Purchase Based on Existing Instance Specifications, you must select a logon key pair. Terms of Service Select ECS Service Terms | Image Service Terms. Advanced Options (optional)
- Purchase Based on Existing Instance Specifications: After you enter the logon password, this key pair is used as the Secure Shell (SSH) logon authentication method for new ECS instances.
- Purchase Based on Instance Launch Template: Network Type specifies the network where the current application you want to scale out is deployed. This parameter cannot be changed. If the current network is a VPC, you must specify the vSwitch that is connected to the new instance. If you specify multiple vSwitches, EDAS automatically allocates vSwitches based on Multi-zone Scaling Policy.
- Existing Resources First: The idle instances in the cluster are first used for automatic scale-outs. If the number of idle instances in the cluster cannot meet the requirement, the auto scaling feature helps you purchase instances.
- Existing Resources: During an automatic scale-out process, the system selects a specified number of idle ECS instances from the cluster where the application is deployed, and adds them to the application.
- Set Number of Instances to Add for Each Scale-Out. This parameter specifies the number of instances that are automatically added after each scale-out operation is triggered.
- Set Maximum Number of Instances in Group: When the number of instances in the cluster reaches the specified maximum number, the system no longer performs scale-outs. Set this parameter based on your resource quota.
View the auto scaling result
- On the Basic Information page of the application, check whether the number of instances is increased or decreased.
- In the left-side navigation pane of the application details page, click Change Records. For a change record whose change type is Scale out Application or Scale in Application and the source is auto_scale, click View in the Actions column. Then, on the Change Details page, you can view the change details.
For more information about scale-out operations in ECS clusters, see the following topics: