• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. User Guide 2.0
  4. Application Management
  5. Application Scaling

Application Scaling

Only manual scaling is supported by stateful applications.

You can choose either of the following scaling modes based on your service requirements:

  • Auto scaling: includes alarm, scheduled, and periodic policies. This mode automatically scales in or out instances on an application based on resource usage, scheduled time, or specified periods.
  • Manual scaling: Manually scale in or out instances on an application immediately after the application is created.

Auto Scaling

You can define auto scaling policies as required, eliminating the need to repeatedly adjust resources in response to changes in service load and reducing resource and labor costs.

Currently, CCE supports the following types of automatic application scaling policies:

Metric-based Policy: scaling based on the CPU or memory settings. After an application is created, instances in this application can be automatically scaled in or out when the number of CPU cores or memory amount exceeds or is less than a specified value.

Scheduled Policy: Instances in an application can be automatically scaled in or out at a specified time. This policy is applicable to high traffic scenarios, such as flash sales and premier shopping events, where a large number of application instances need to be added.

Periodic Policy: Instances in an application can be automatically scaled in or out daily, weekly, or monthly. This policy is applicable to scenarios where traffic changes periodically.

  • Metric-based policy: scaling based on the CPU or memory settings.
    1. Log in to the CCE console. In the navigation pane, choose Application Management. Click the application for which the scaling policy is to be set. On the Application Details page, click the Scaling tab.
    2. In the Auto Scaling area, click Add Scaling Policy.
      Table 1 Parameters for adding a metric-based policy

      Parameter

      Description

      Policy Name

      Name of the scaling policy.

      Policy Type

      Type of the policy. Set it to Metric-based policy.

      Metric

      Set it to CPU usage or Physical memory usage.

      If you set this parameter to Physical memory usage and set the average value to be greater than 70%, the scaling policy is triggered when memory usage exceeds 70%.

      Trigger Condition

      Duration

      Metric statistics period. Select a value from the drop-down list box.

      If the parameter is set to 60s, metric statistics is collected every 60 seconds.

      Consecutive Times

      If the parameter is set to 3, the action is triggered if threshold is reached for three consecutive measurement periods.

      Action

      Whether a scale-in or scale-out is triggered.

    3. Click OK.
    4. In the Auto Scaling area, check that the policy has been started.
      Figure 1 Policy started

      When the trigger condition is met, the auto scaling policy starts automatically.

  • Scheduled policy: scaling at a specified time.
    1. Log in to the CCE console. In the navigation pane, choose Application Management. On the page that is displayed, click the application for which the scaling policy is to be set. On the Application Details page, click the Scaling tab.
    2. In the Auto Scaling area, click Add Scaling Policy.
      Table 2 Parameters for adding a scheduled policy

      Parameter

      Description

      Policy Name

      Name of the scaling policy.

      Policy Type

      Type of the policy. Set this parameter to Scheduled policy.

      Trigger Time

      Time at which the policy is enforced.

      Action

      Whether a scale-in or scale-out is triggered.

    3. Click OK.
    4. In the Auto Scaling area, check that the policy has been started.
      Figure 2 Policy started

      When the trigger time is reached, you can see on the Instances tab page that the auto scaling policy has taken effect.

  • Periodic policy: scaling at a specified time on a daily, weekly, or monthly basis.
    1. Log in to the CCE console. In the navigation pane, choose Application Management. On the page that is displayed, click the application for which the scaling policy is to be set. On the Application Details page, click the Scaling tab.
    2. In the Auto Scaling area, click Add Scaling Policy.
      Table 3 Parameters for adding a periodic policy

      Parameter

      Description

      Policy Name

      Name of the scaling policy.

      Policy Type

      Type of the policy. Set this parameter to Periodic policy.

      Select Time

      Time at which the policy is enforced.

      Action

      Whether a scale-in or scale-out is triggered.

    3. Click OK.
    4. In the Auto Scaling area, check that the policy has been started.
      Figure 3 Policy started

      When the trigger condition is met, the auto scaling policy starts automatically.

Manual Scaling

  1. Log in to the CCE console. In the navigation pane, choose Application Management. On the page that is displayed, click the application to be scaled. On the Application Details page, click the Scaling tab.
  2. In the Manual Scaling area, click  to modify the number of instances, and click Save. The instance scaling takes effect immediately.
  3. On the Instances tab page, check that a new instance is being created. When the instance status becomes Running, instance scaling is complete.