In PolarDB for MySQL, a cluster can be automatically scaled up/out and back. You can set this feature on the Basic Information page of your PolarDB for MySQL cluster. This topic describes how to set this feature.
Background information
It takes at least 15 minutes for automatic configuration changes to take effect. We recommend that you do not use this configuration change method during short-term business surges. If you do not want the system to automatically scale your cluster back after a scale-up/out, you can choose not to enable Auto Scaling-in. PolarDB for MySQL provides multiple configuration change methods.
- Manual configuration change: If you want to permanently change the configuration of your PolarDB cluster, we recommend that you manually upgrade or downgrade the cluster. For more information, see Manually upgrade or downgrade a PolarDB cluster.
- Temporary scale-up: This method is suitable for short-term business surges. For more information, see Temporary upgrade.
- Automatic configuration change (auto scaling): The system can automatically scale your clusters based on your business workloads. This feature is not suitable for short-term business surges.
- DAS-based scaling: If your business frequently experiences drastic fluctuations, we recommend that you use the auto scaling provided by Database Autonomy Service (DAS). For more information, see Configure the auto scaling feature of DAS.
Prerequisites
- The PolarDB for MySQL cluster is of the Cluster Edition or X-Engine Edition. Single Node Edition and Multi-master Cluster (Database/Table) Edition do not support this feature. For more information about cluster editions, see Overview of editions.
- No cluster specification change tasks are being performed for the PolarDB cluster.
Billing
Both the pay-as-you-go and subscription billing methods are supported for this feature.Pay-as-you-go
Pay-as-you-go clusters are charged on an hourly basis. After you change the configuration of a pay-as-you-go cluster, the cluster is charged at the new price on an hourly basis.
SubscriptionChange type | Description |
---|---|
Upgrade specifications or add nodes | Payment = Total fees of the new configuration for the remaining subscription period (Monthly price of the new configuration/30/24 × Remaining subscription period measured in hours) - Total fees of the original configuration for the remaining subscription period (Monthly price of the original configuration/30/24 × Remaining subscription period measured in hours) For example, the monthly price of the new configuration is USD 14,400. The monthly price of the original configuration is USD 7,200. The remaining subscription period is 50 days. The payment is calculated based on the following formula: (USD 14,400/30/24 × 50 × 24) - (USD 7,200/30/24 × 50 × 24) = USD 12,000. |
Downgrade specifications or delete nodes | Refund = Total fees of the original configuration for the remaining subscription period (Monthly price of the original configuration/30/24 × Remaining subscription period measured in hours) - Total fees of the new configuration for the remaining subscription period (Monthly price of the new configuration/30/24 × Remaining subscription period measured in hours). For example, to purchase a subscription cluster for three months, you are charged USD 3,500. You pay USD 3,000 for the cluster after you use coupons. After two months, the total fees of the original configuration for the remaining subscription period become USD 1,000. The total fees of the new configuration for a month are USD 800. The refund is calculated based on the following formula: USD 1,000 - USD 800 = USD 200. Note You can receive a refund for a downgraded configuration of a subscription cluster. However, fees for the entire cluster cannot be refunded. If you want to apply for a refund for the entire cluster, submit a ticket. If your application is approved, your subscription cluster is frozen and will be deleted after 14 days. |
Refunds for cluster downgrade
When the specifications of a subscription cluster exceed your business requirements and your account has the configuration downgrade privilege, you can downgrade the configurations of the cluster in real time. For information about the refund policy, see Rules for unsubscribing from resources.
Precautions
- You can upgrade or downgrade only clusters. You cannot upgrade or downgrade a single node in a cluster.
- When you upgrade or downgrade a cluster, data stored in the cluster is not affected.
- During the upgrade or downgrade process, your applications are temporarily disconnected from the cluster for no more than 30 seconds. We recommend that you upgrade or downgrade your cluster during off-peak hours and make sure that your applications are configured with the automatic reconnection mechanism.
- A cluster upgrade or downgrade has minor impacts on the primary node of a PolarDB cluster. However, the upgrade or downgrade degrades the performance of read-only nodes in the cluster. As a result, the read-only nodes require more time to handle requests during the upgrade or downgrade process.
Procedure
- Log on to the PolarDB console.
- In the upper-left corner of the console, select the region in which the cluster that you want to manage is deployed.
- On the Clusters page, click the ID of the cluster.
- On the Overview page, click Settings in the upper-right corner of the Database Nodes section.
- In the dialog box that appears, configure the following parameters.
Parameter Description Auto Scaling-out Specifies whether to enable the auto scaling feature. Observation Period If the CPU utilization reaches the specified threshold during the observation period, PolarDB automatically adds nodes or upgrades the specifications of your cluster when the observation period ends. The system determines the scaling method based on the incoming read and write requests. The minimum observation period is 5 minutes, and a scaling activity needs 15 minutes to be completed. Therefore, it takes at least 15 minutes for the auto scaling to take effect. For example, if the observation period is 5 minutes and the time required to complete a scaling activity is 10 minutes, you must wait 15 minutes before you can check the scaling result. CPU Usage The average CPU utilization threshold over which auto scaling is triggered. If the CPU Usage is greater than or equal to the specified value, an auto scale-out activity is triggered. Maximum Specification The highest specifications to which a cluster can be upgraded. After an auto scaling is triggered, the system may upgrade the specifications of the PolarDB cluster tier-by-tier until the highest specifications are applied. For example, the cluster is upgraded from 4 cores to 8 cores, and then to 16 cores. Maximum Number of Read-only Nodes The maximum number of read-only nodes that can be automatically added to the cluster. After an auto scaling is triggered, the system adds one or two read-only nodes each time until the specified upper limit is reached. Note- The nodes that are automatically added are associated with the default cluster endpoint. If the cluster uses a custom endpoint, you must specify whether to associate these nodes with the endpoint by specifying the Automatically Associate New Nodes parameter. For more information about Automatically Associate New Nodes, see Configure PolarProxy.
- If you want the system to perform only scale-up and no scale-out, set this parameter to the current number of read-only nodes of the cluster.
- During a scale-up, transient connections occur to all nodes of the cluster. This does not occur during a scale-out.
Auto Scaling-in Specifies whether to enable automatic scale-back. Note After Auto Scaling-in is enabled, if the average CPU utilization of automatically scaled nodes remains at less than 30% for more than 99% of the quiescent period, the PolarDB cluster is scaled back tier-by-tier to the original specifications when the quiescent period ends.Quiescent Period The minimum interval between two scaling activities. During a quiescent period, PolarDB monitors the resource usage of a cluster but does not trigger scaling activities. If a quiescent period and an observation period end at the same time and the CPU utilization reaches the threshold value within the observation period, PolarDB automatically triggers the auto scaling operation. - Click OK.