All Products
Search
Document Center

PolarDB:Set a scaling policy for serverless cluster resources

Last Updated:Nov 21, 2025

After you create a serverless cluster, you can customize its resource scaling policy to meet the requirements of different service workloads.

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.

Note

The preceding thresholds are default values. The thresholds vary based on the kernel parameters and serverless configurations of clusters.

Notes

  • Serverless clusters use the PolarDB Capacity Unit (PCU) for per-second billing and resource scaling. One PCU is approximately equivalent to 1 CPU core and 2 GB of memory. The number of PCUs for a node is dynamically adjusted based on the service workload, within the upper and lower limits that you set. The minimum step size for a single scaling event is 0.5 PCU.

  • When the workload of a serverless cluster changes, the nodes of the serverless cluster are not immediately scaled to the target specifications. Instead, they are scaled in increments to gradually reach the target specifications. The minimum step size for a single scaling event is 0.5 PCU. To adapt more quickly to the current service traffic, the serverless cluster automatically increases the step size for the next scaling event based on the current number of PCUs.

Set serverless configuration parameters

  1. Log on to the PolarDB console. In the navigation pane on the left, click Clusters. Select the region where your cluster is located, and then click the ID of the target cluster to open the cluster details page.

  2. On the Basic Information page, in the Database Nodes section, click Serverless Configuration.

    image.png

  3. 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 in the cluster. Valid values: 1 PCU to 31 PCU.

      • Maximum Resources for Single Node: The maximum number of PCUs per node in the cluster. Valid values: 1 PCU to 32 PCU.

      Note

      Example: If you set Minimum Resources for Single Node to 2 PCU and Maximum Resources for Single Node to 16 PCU, the default specification for the primary and read-only nodes in the serverless cluster is 2 PCU (approximately 2 cores and 4 GB of memory). When the system detects an increase in service workload, it automatically increases the number of PCUs for the primary or read-only nodes. However, the number of PCUs for each node cannot exceed the maximum of 16 PCU (approximately 16 cores and 32 GB of memory).

      • Minimum Read-only Nodes: The minimum number of read-only nodes. Valid values: 0 to 7.

      • Maximum Read-only Nodes: The maximum number of read-only nodes. Valid values: 0 to 7.

      Note
      • To ensure high availability (HA) for the serverless cluster, set Minimum Read-only Nodes to 1.

      • The number of read-only nodes automatically increases or decreases within the specified limits based on the actual service workload. For more information, see Auto scaling.

    • Advanced Mode

      You can adjust the advanced configuration parameters based on the current workload of the serverless cluster.

      • Scan Interval: In Sensitive mode, the cluster responds faster to workload changes, which means it uses a shorter observation window and running time. From the drop-down list, select Standard or Sensitive.

      • Maximum CPU Resources for Elastic Upgrade (Upper limit): The CPU utilization threshold that triggers a scale-up. Valid values: 40% to 100%.

      • Minimum CPU Resources for Elastic Upgrade (Lower limit): The CPU utilization threshold that triggers a scale-down. Valid values: 10% to 70%.

      Note
      • The CPU scale-down threshold cannot be greater than the CPU scale-up threshold (Lower limit < Upper limit). The difference between the scale-up and scale-down thresholds must be 30 or greater (Upper limit - Lower limit >= 30).

      • Sensitive mode is suitable for services that are sensitive to transient workload fluctuations, such as sudden CPU spikes, and require a faster response. However, this may cause the cluster to scale more frequently in response to workload fluctuations.

    • Run on Schedule: Set a specific time to apply the serverless configuration changes. This setting lets you automatically scale up the serverless configuration to ensure performance before predictable traffic peaks, such as during promotions. The default value is Run Now.

      Note

      Each cluster can have only one pending schedule at a time.

  4. Click OK.

Related API operations

API

Description

DescribeDBClusterServerlessConf

Queries the configuration of a serverless cluster.

ModifyDBClusterServerlessConf

Modifies the configuration of a serverless cluster.