Auto scaling is an important O&M capability for distributed application management. The auto scaling feature provided by EDAS perceives the status of each instance for an application and accordingly implements dynamic scaling. This ensures service quality and improves application availability.

Overview

Applications such as Internet and game applications are prone to sudden traffic floods during promotional activities. The imbalance between SLA and resource costs causes issues such as system response latency and system breakdown. EDAS inherits the traffic flood management technology used by Alibaba to cope with Double 11. This provides second-level auto scaling to reduce instance retention costs and ensure SLA. 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 Cluster. 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.

Auto scaling determines whether to enable a scale-out or a scale-in and implements automatic scaling based on the following metrics of an application instance:
  • 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

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.

Note
  • 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.
  1. Log on to the EDAS console.
  2. 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.
  3. In the left-side navigation pane of the application details page, click Auto Scaling.
  4. In the upper-right corner of the Scale-Out Rule section, turn on the switch to enable the scale-out rule.
  5. Configure the scale-out rule parameters. In the lower-left corner of the Auto Scaling page, click Save.
    1. 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.
    2. 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: Auto scale-out is triggered only when the thresholds of all metrics are exceeded.
    3. Last for More Than: indicates the duration when the metric continuously reaches the threshold, in minutes. Within the duration, if the average value of a metric every minute continuously reaches the set threshold, auto scale-out is triggered. You can configure the duration based on the sensitivity of the cluster service capabilities.
    4. 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.
        The protocol used by the 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.
    5. 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.
    6. 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

After you configure auto scaling rules, if an auto scale-out or an auto scale-in is performed, you can use the following methods to 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.

References

For more information about scale-out operations in ECS clusters, see the following topics: