The auto scaling feature automatically adjusts an instance's resources in response to traffic fluctuations, ensuring performance during traffic peaks and reducing costs during low-traffic periods. MSE supports two auto scaling policies: scheduled scaling and metric-based scaling. This topic describes how to configure auto scaling policies.
Auto scaling applies only to standard cloud-native gateway instances. Serverless instances scale automatically based on workload and do not support manual scaling or modifying specifications. You do not need to perform detailed capacity planning for them.
Choose a scaling policy
-
Scheduled scaling
Scheduled scaling is ideal for scenarios with predictable, recurring traffic patterns. For example, you can use scheduled scaling to handle traffic spikes during predictable events, such as major promotions or online games.
-
Metric-based scaling
Metric-based scaling is suitable for scenarios with irregular or unpredictable traffic fluctuations. It dynamically adjusts the number of nodes based on monitoring metrics such as CPU and memory usage. For more information about capacity, see Capacity planning.
Considerations
-
During a scaling event, you cannot modify the auto scaling policy.
-
While an auto scaling policy is active, newly added elastic nodes are billed on a pay-as-you-go basis. The cost depends on the number of nodes and their usage duration.
-
Disabling auto scaling does not remove existing elastic nodes. To save costs, you can upgrade these elastic nodes to fixed nodes.
Scaling configuration
-
Log on to the MSE console. In the top navigation bar, select a region.
-
In the left-side navigation pane, choose Cloud-native Gateway > Gateways. On the Gateways page, click the ID of the gateway.
-
On the Gateways page, find the target instance and click Actions > Auto Scale-out in the Actions column.
-
In the Auto Scale-out panel, on the Scaling Configuration tab, turn on the Enable Auto Scaling switch and configure the parameters.
The following table describes the parameters.
NoteWhen you update a scheduled scaling policy, a new time range that starts later than the current time will take effect in the next 24-hour cycle.
ImportantWe recommend that you associate your gateway with an NLB instance. You must also ensure that your backend microservices support scaling. Otherwise, auto scaling will be ineffective across the entire request path. For more information about managing the gateway's ingress SLB, see Manage the ingress SLB of a gateway.
Parameter
Description
Enable Auto Scaling
Enables or disables the auto scaling policy.
-
When enabled, you cannot manually scale the instance or modify its specifications.
-
If you turn off this switch during an auto scaling event, the existing elastic nodes are not removed. To save costs, you can upgrade these elastic nodes to fixed nodes.
-
If auto scaling is disabled while elastic nodes exist, you can only perform an upgrade. This upgrade is limited to increasing the number of nodes; you cannot modify gateway specifications.
NoteFor example, assume your gateway initially has three 2-core 4 GB nodes. Auto scaling is triggered, and two elastic nodes are added. If you then disable auto scaling, the two elastic nodes are retained and continue to be billed as elastic nodes. You can upgrade the elastic nodes to fixed nodes:
-
If you upgrade the gateway to four 2-core 4 GB nodes, one elastic node becomes a fixed node, leaving one elastic node. Because an elastic node still exists, the next time you manually modify specifications, you can only increase the number of nodes.
-
If you upgrade the gateway to six 2-core 4 GB nodes, both elastic nodes become fixed nodes, and one additional fixed node is created. After this upgrade is complete, no elastic nodes remain. The next time you manually modify specifications, you can freely change both the gateway specifications and the number of nodes.
-
Scaling Method
Currently, Scale by Time and Scale by Metric are supported.
-
Scale by Time: Recommended for scenarios with high traffic at fixed times. You can use this method in conjunction with rate limiting.
-
Scale by Metric: Scaling adjustments are processed on a minute-by-minute basis and are not instantaneous.
Scale by Time
Time Range (UTC+8)
Configure the time ranges for scheduled scaling. You can configure one to three non-overlapping time ranges within a 24-hour period. Time ranges can span across days.
Note-
The duration is measured in whole hours. Partial hours are rounded up to the next full hour.
-
Duplicate time ranges are not allowed.
Target Number of Nodes
The total number of nodes to scale out to within the specified time range. The gateway automatically scales back in to its original number of fixed nodes at the end of the time range. The target number cannot exceed twice the number of fixed nodes.
Scale by Metric
Maximum Number of Nodes
The upper limit on the total number of nodes that the gateway can scale out to.
Safe Watermark
Ensures high throughput and low latency even if a sudden traffic burst doubles the current load.
Warning Watermark
When the warning watermark is reached, gateway latency may increase. For information about capacity thresholds and Queries Per Second (QPS) for different specifications, see Capacity planning.
Allowed Scale-in Period
The time window during which the system is permitted to perform scale-in operations (reduce nodes).
Note-
The duration is measured in whole hours. Partial hours are rounded up to the next full hour.
-
Duplicate time ranges are not allowed.
-
Scaling Events
Click the Scaling Events tab in the Auto Scaling panel to open the Events page. On this page, you can manage and analyze the execution history of auto scaling events for your cloud-native gateway. For more information, see Overview of the MSE Event Center.
Billing
Elastic nodes are billed separately on a pay-as-you-go basis. Ensure that your account balance is sufficient.