tencent cloud

Service Registry and Governance

Elastic scaling

PDF
Mode fokus
Ukuran font
Terakhir diperbarui: 2026-05-07 17:21:36

Scenarios

Cloud Native API Gateway can automatically increase or decrease the number of nodes (scale-out or scale-in) based on preset AS rules, thereby improving resource utilization and reducing resource costs. AS supports two types of scaling policies: metric scaling and scheduled scaling. (Only supported in the Pro Edition)
Metric scaling: applies to scenarios with sudden traffic spikes and typical periodic traffic. The elastic scaling trigger condition and node quantity change are described using the metric name and threshold.
Scheduled scaling: applies to application scenarios where resource utilization follows a periodic pattern. After the configured periodic time point is reached, the TSF Cloud Native API Gateway automatically adjusts the number of instance nodes according to the configured policy.

Prerequisite

Operation Steps

Step 1: Creating an Elastic Scaling Policy

2. In the left sidebar, choose Cloud Native API Gateway > Instance List, click the ID of the target instance, and go to the Basic Information page of the gateway instance.
3. On the Basic Information page, select the Elastic Scaling tab and click Create Policy.

4. In the displayed Create Elastic Scaling Policy dialog box, specify the policy information:
Metric Scaling Only
Scheduled Scaling Only
Metric and Scheduled Scaling
Node Quantity Range: number of nodes for elastic scaling. The minimum value is the number of nodes in the group, and the maximum value is 20.
Metric Scaling: Elastic scaling is triggered when one condition is met.
Metric Name: elastic scaling trigger condition. You can configure thresholds for monitoring metrics (CPU utilization, memory utilization, and QPS).
Threshold: threshold of the metric for triggering elastic scaling.
Policy Name: Enter the name of the elastic scaling policy.
Description: Enter the description of the elastic scaling policy.
Node Quantity Range: number of nodes for elastic scaling. The minimum value is the number of nodes in the group, and the maximum value is 20.
Scheduled Scaling: If multiple rules are triggered at the same time, they are executed in sequence. You can drag the rules to adjust the order. If the trigger time of a rule is earlier than the current time, the rule takes effect from the next period.
Period: period for executing the scheduled elastic scaling policy.
Node Quantity: number of nodes after elastic scaling takes effect.
Policy Name: Enter the name of the elastic scaling policy.
Description: Enter the description of the elastic scaling policy.
Node Quantity Range: number of nodes for elastic scaling. The minimum value is the number of nodes in the group, and the maximum value is 20.
Scheduled Scaling: If multiple rules are triggered at the same time, they are executed in sequence. You can drag the rules to adjust the order. If the trigger time of a rule is earlier than the current time, the rule takes effect from the next period.
Period: period for executing the scheduled elastic scaling policy.
Node Quantity: number of nodes after elastic scaling takes effect.
Metric Scaling: Elastic scaling is triggered when one condition is met.
Metric Name: elastic scaling trigger condition. You can configure thresholds for monitoring metrics (CPU utilization and memory utilization).
Threshold: threshold of the metric for triggering elastic scaling.
Policy Name: Enter the name of the elastic scaling policy.
Description: Enter the description of the elastic scaling policy.
5. Click Confirm. A dialog box is displayed, indicating that the elastic scaling policy takes effect only after it is bound to a cluster group. You can bind a group directly or later.

Step 2: Binding a Cluster Group for an Elastic Scaling Policy to Take Effect

An elastic scaling policy takes effect only after it is bound to a cluster group. You can bind one or more cluster groups at a time.
1. On the Elastic Scaling tab page, click Bind Group on the right of the target policy in the policy list.
2. In the displayed Bind Cluster Group dialog box, select one or more cluster groups and click Confirm. The policy takes effect immediately after it is bound to a group.

Step 3: Viewing Cluster Groups Bound to a Policy

1. On the Elastic Scaling tab page, click the target policy in the policy list to go to the policy details page.
2. Click the Bound Group tab page to view the cluster groups bound to the policy. You can bind new groups or unbind existing groups.


Step 4: Editing an Elastic Scaling Policy

1. On the Elastic Scaling tab page, click Edit on the right of the target policy in the policy list.
2. On the Edit Elastic Scaling Policy page, modify the trigger condition, elastic scaling range, name, or description of the policy.
3. Click OK to complete the editing.

Step 5: Deleting an Elastic Scaling Policy

1. On the Elastic Scaling tab page, click Delete on the right of the target policy in the policy list.
2. In the displayed Delete Policy dialog box, confirm whether to delete the policy again.
3. Click OK. The policy is deleted.
Note:
After deletion, the policy becomes invalid immediately, is automatically unbound from the previously bound group, and stops performing automatic scaling. Proceed with caution.

Configuring Metric Scaling and Scheduled Scaling Simultaneously

Scheduled scaling triggers elastic scaling of gateway nodes by setting a scheduled time, which is commonly used in periodic tasks. Metric scaling triggers elastic scaling of nodes by configuring key metric thresholds, which is commonly used to prevent sudden traffic spikes. In actual use, you can configure both methods. When Cloud Native API Gateway detects that both policies are configured, it adjusts the node quantity based on the content of the two policies.
When both policies take effect, scheduled scaling does not adjust the number of nodes directly. Instead, it adjusts the node quantity range of metric scaling for scaling judgment and adjustment. The adjustment rules are as follows:
When the current number of nodes is equal to the number of target nodes of scheduled scaling, adjustment is not performed.
When the current number of nodes is less than the number of target nodes of scheduled scaling:
If the number of target nodes of scheduled scaling is greater than the minimum number of nodes of metric scaling, adjust the minimum number of nodes of metric scaling to the target number of nodes of scheduled scaling.
If the number of target nodes of scheduled scaling is less than the maximum number of nodes of metric scaling, the maximum number of nodes of metric scaling is not adjusted.
When the current number of nodes is greater than the number of target nodes of scheduled scaling:
If the number of target nodes of scheduled scaling is greater than the minimum number of nodes of metric scaling, the minimum number of nodes of metric scaling is not adjusted.
If the number of target nodes of scheduled scaling is less than the maximum number of nodes of metric scaling, the maximum number of nodes of metric scaling is not adjusted.
The number of nodes is adjusted accordingly based on the node quantity range of metric scaling to achieve elastic scaling of nodes.
The following table describes the node scaling results in different scenarios when the two policies take effect simultaneously.
Number of Nodes of Metric Scaling (Before Adjustment)
Number of Target Nodes of Scheduled Scaling
Current Number of Nodes
Number of Nodes of Metric Scaling (After Adjustment)
Number of Nodes (After Adjustment)
Minimum value: 1; Maximum value: 10
5
5
Minimum value: 1; Maximum value: 10
5
Minimum value: 1; Maximum value: 10
7
5
Minimum value: 7; Maximum value: 10
7
Minimum value: 1; Maximum value: 10
3
5
Minimum value: 1; Maximum value: 10
5


Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan