After you enable the serverless feature for a cluster with defined specifications, you can customize the scaling policy of the cluster to control its scaling limits.
Auto scaling
Trigger conditions for resource scale-up and scale-out
Trigger conditions for resource scale-up
PolarDB monitors the CPU utilization, memory utilization, and other kernel metrics of the primary and read-only nodes. During a monitoring cycle, the scale-up of serverless resources is triggered when one of the following conditions is met:
When the CPU utilization of a node exceeds 85%, a resource scale-up is triggered for the node.
When the memory utilization of a node exceeds 85%, a resource scale-up is triggered for the node.
When the specifications of a read-only node are less than half of the specifications of the primary node, the scale-up of the specifications of the read-only node is triggered. For example, if the specifications of a read-only node are 4 PCUs and the specifications of the primary node are 10 PCUs, the specifications of the read-only node are scaled to at least 5 PCUs.
Trigger conditions for resource scale-out
If the resources of read-only nodes of a cluster are scaled up to the specified upper limit, but the CPU utilization or memory utilization of the nodes still meets the trigger conditions for a resource scale-up (higher than 85%), a scale-out of read-only nodes is triggered.
Trigger conditions for resource scale-down
When the CPU utilization of a node is lower than 55% and the memory utilization is lower than 40%, a resource scale-down is triggered for the node.
The preceding thresholds are default values. The thresholds vary based on the kernel parameters and serverless configurations of clusters.
Prerequisites
You have enabled the serverless feature for a cluster with defined specifications.
Precautions
Disabling the serverless feature of a cluster with defined specifications requires you to restart the PolarDB cluster. To avoid affecting business continuity, perform this operation during off-peak hours.
Serverless uses PolarDB Capacity Units (PCUs) for per-second billing and resource elasticity. One PCU is approximately equivalent to 1 core and 2 GB of memory. The number of PCUs for a node is dynamically adjusted based on the workload within the limits that you set. The minimum unit for a single scaling event is 0.5 PCU.
Modify serverless configuration parameters
Log on to the PolarDB console. In the navigation pane on the left, click Clusters. Select the region where the cluster is located, and then click the ID of the target cluster to open the cluster details page.
On the Basic Information page, in the Database Nodes section, click Serverless Configuration.

In the Configure Serverless-related Parameters dialog box, configure the following parameters as needed.
Basic Configuration
Minimum Resources for Single Node: The minimum number of PCUs per node. Valid values: 0 to 16.
Maximum Resources for Single Node: The maximum number of PCUs per node. Valid values: 0 to 16.
NoteFor example, if you set Minimum Resources for Single Node to 2 and Maximum Resources for Single Node to 8, the minimum specification for a node becomes its defined specifications plus 2 PCU (approximately 2 cores and 4 GB of memory). When the business load increases, the system automatically adds PCUs to the nodes. Based on these settings, the serverless resources can be scaled up to a maximum of 8 PCU. This means the total specification for a node can reach its defined specifications plus 8 PCU (approximately 8 cores and 16 GB of memory).
Minimum Number of Read-only Nodes: The minimum number of additional read-only nodes for scale-out. Valid values: 0 to 15.
Maximum Number of Read-only Nodes: The maximum number of additional read-only nodes for scale-out. Valid values: 0 to 15.
NoteThe number of read-only nodes automatically increases or decreases within the specified range based on the workload. For more information, see Auto scaling.
Advanced Mode
Adjust the advanced configuration parameters based on the resource pressure of the current serverless cluster.
Scan Interval: In Sensitive mode, serverless resources respond faster to workload changes due to a shorter observation window and running time. Set this parameter to Standard or Sensitive.
Maximum CPU Resources for Elastic Upgrade: The CPU utilization threshold that triggers a scale-up. Valid values: 40% to 100%.
Minimum CPU Resources for Elastic Upgrade: The CPU utilization threshold that triggers a scale-down. Valid values: 10% to 70%.
NoteThe value of CPU Scale-down Threshold cannot be greater than the value of CPU Scale-up Threshold. The difference between the two thresholds must be at least 30 percentage points.
The Sensitive mode is suitable for services that are sensitive to transient workload fluctuations, such as instantaneous CPU spikes, and require a faster response. However, this may cause the cluster to scale up and down more frequently in response to workload fluctuations.
Click OK.
Disable the serverless feature
If your cluster no longer requires the serverless feature, you can disable it. After you disable this feature, any PCUs and read-only nodes that were added by the serverless feature are released. Your cluster then reverts to a cluster with defined specifications.
Log on to the PolarDB console. In the navigation pane on the left, click Clusters. Select the region where the cluster is located, and then click the ID of the target cluster to open the Basic Information page.
On the Basic Information page, in the Database Nodes section, click Disable Serverless.

Related API
API | Description |
Queries the configurations of a serverless cluster. | |
Modifies the serverless configurations of a cluster. | |
Disables the serverless feature for a cluster with defined specifications (steady-state serverless). |