All Products
Search
Document Center

PolarDB:Configure auto scaling for a serverless cluster

Last Updated:Oct 13, 2026

serverless cluster allows you to customize resource scaling policies to effectively control the upper and lower limits of cluster resource elasticity. In addition, the cluster supports scheduled policies, enabling you to automatically scale up before predictable traffic peaks (such as promotions and traffic spikes) to ensure performance, and scale down during off-peak periods to release idle resources.

Auto scaling

Scale-up and scale-out triggers

  • Vertical scaling (scale-up)

    PolarDB monitors the CPU utilization, memory usage, and other kernel-level metrics of the primary and read-only nodes. During a monitoring period, the system typically triggers a scale-up for a node when any of the following conditions is met:

    • The CPU utilization is higher than the preset threshold (default: 80%).

    • The memory usage is higher than a specific threshold:

      Serverless format

      Scale-up threshold

      Serverless cluster

      90%

      Serverless feature for clusters with defined specifications

      Less than or equal to 32 GB

      90%

      64 GB

      92%

      128 GB

      96%

      256 GB to 512 GB

      98%

      Other memory specifications

      Vertical scaling is not supported.

    • A read-only node's specifications are less than half of the primary node's.

      For example, if a read-only node has specifications of 4 PCU and the primary node has specifications of 10 PCU, the read-only node is scaled up to at least 5 PCU.

  • Horizontal scaling (scale-out)

    If a read-only node in a cluster has scaled up to its configured maximum limit and still meets the scale-up trigger conditions (for example, its CPU utilization exceeds the custom threshold), a horizontal scale-out is triggered.

Scale-down and scale-in triggers

  • Vertical scaling (scale-down)

    A scale-down is triggered for a node when its CPU utilization falls below the custom threshold (default: 50%) and its memory usage is below a specific threshold. The memory usage thresholds are as follows:

    Serverless format

    Scale-down threshold

    Serverless cluster

    80%

    Serverless feature for clusters with defined specifications

    Less than or equal to 32 GB

    80%

    64 GB

    86%

    128 GB

    90%

    256 GB to 512 GB

    94%

    Other memory specifications

    Vertical scaling is not supported, so no scale-down threshold applies.

  • Horizontal scaling (scale-in)

    A scale-in is triggered for a read-only node if its CPU utilization remains below 15% and the CPU utilization of all other read-only nodes remains below 60% for a sustained period of 15 to 30 minutes.

    Note
    • To prevent node jitter, only one read-only node is scaled in at a time. The cooldown period between consecutive scale-in events is 15 to 30 minutes.

    • To immediately scale in all read-only nodes, modify the Serverless Configuration. Setting both the Maximum Number of Read-only Nodes and Minimum Number of Read-only Nodes to 0 immediately triggers a scale-in of all read-only nodes.

Note
  • The metrics for triggering scaling vary based on cluster parameter configurations and serverless configurations. You can specify thresholds for CPU scaling, but cannot change thresholds for other metrics.

  • When the workloads of a serverless cluster suddenly increase, the nodes of the cluster are scaled step by step to approach the expected specifications, instead of one step at a time. The minimum step size for node scaling is 0.5 PCUs. To quickly adapt to the current workloads, the next scaling step size increases based on the current number of PCUs per node.

  • To detect scaling events, you can configure alert rules in the Performance Monitoring section of the console. For more information, see Set up elastic monitoring.

Important notes

  • The maximum number of connections for a serverless cluster is 100,000, and the maximum IOPS is 84,000.

  • A serverless cluster uses PCU (PolarDB Capacity Unit) as the unit for per-second billing and resource scaling. 1 PCU is approximately equivalent to the standard service capacity of 1 core and 2 GB of memory. The PCU of each node is dynamically adjusted based on the workload within the range you specify. The minimum scaling increment is 0.5 PCU.

Configure serverless parameters

You can Log in to the PolarDB console,In the navigation pane on the left, click Clusters. Select the Region where the cluster is deployed, and then click the cluster ID to go to the cluster details page。 On the Basic Information page, in the Database Nodes section, click Serverless Configuration to configure.

Configure current parameters

In the Configure Serverless-related Parameters dialog box, click Edit to configure the following parameters.

  • Current parameters

    • Minimum Read-only Nodes: the minimum number of read-only nodes that can be added. Valid values: 0 to 15.

    • Maximum Read-only Nodes: the maximum number of read-only nodes that can be added. Valid values: 0 to 15.

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

    • To ensure high availability of the serverless cluster, we recommend that you set Minimum Read-only Nodes to 1.

    • Minimum Resources for Single Node: the minimum PCU for each node in the cluster. Valid values: 0.25 PCU to 32 PCU.

    • Maximum Resources for Single Node: the maximum PCU for each 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 specifications of the primary node and read-only nodes in the serverless cluster are 2 PCU (approximately 2 cores and 4 GB of memory). When the system detects increased workloads, it automatically increases the PCU of the primary node or read-only nodes up to a maximum of 16 PCU (approximately 16 cores and 32 GB of memory).

    • Number of IMCI Read-only Nodes: set the number of IMCI read-only nodes. Valid values: 0 to 15. This parameter independently controls the scaling limit for IMCI read-only nodes and is calculated separately from the maximum number of read-only nodes (ScaleRoNumMax). The two parameters are independent and do not include each other. For example, if you set the maximum number of read-only nodes to 10 and the number of IMCI read-only nodes to 5, the cluster can have up to 10 row-store read-only nodes and 5 IMCI read-only nodes.

      Note
      • Number of IMCI Read-only Nodesis a fixed value and does not support automatic horizontal scaling. To adjust the number, manually modify this parameter. The scale-in trigger conditions (such as CPU utilization below 15%) apply only to regular read-only nodes.

      • To add IMCI read-only nodes, make sure that the cluster has at least one read-only node. This means you must first setMinimum Read-only Nodesto 1.

      • The total number of IMCI read-only nodes and read-only nodes cannot exceed 15.

      • For more information about IMCI read-only nodes, seeWhat is In-Memory Column Index (IMCI).

    • Enable No-activity Suspension: If your serverless cluster does not receive requests within specific periods of time, you can configure the automatic start and stop feature for the instance. After you enable this feature and if no service is connected to the cluster within the period defined by the Detection Period for No-activity Suspension parameter, the cluster automatically enters the suspended state. During the suspension period, you are still charged for the storage space on a pay-as-you-go basis. If any service is connected to the cluster, the cluster immediately starts.

    • Detection Period for No-activity Suspension: the detection period ranges from 5 minutes to 24 hours and must be a multiple of 5 minutes.

  • Advanced settings

    You can flexibly adjust the advanced parameters based on the resource pressure of the serverless cluster.

    • Scan Interval: in Sensitive mode, serverless resources respond to workload pressure more quickly with shorter observation windows and execution times. Select Standard or Sensitive.

    • Maximum CPU Resources for Elastic Upgrade (maximum): the CPU scale-up threshold. Valid values: 40% to 100%.

    • Minimum CPU Resources for Elastic Upgrade (minimum): the CPU scale-down threshold. Valid values: 10% to 70%.

    Note
    • The CPU scale-down threshold must be less than the CPU scale-up threshold (minimum < maximum), and the difference between the two thresholds must be at least 30 (maximum - minimum >= 30).

    • Sensitive mode is suitable for workloads that are sensitive to transient load fluctuations (such as CPU spikes) and require faster response times. However, the cluster may scale up and down more frequently based on workload changes.

Configure a scheduled policy

A scheduled policy automatically triggers resource scaling based on predefined time rules (such as specific times on certain days of each month, week, or day). This policy allows you to automatically scale up before predictable traffic peaks (such as promotions and traffic spikes) to ensure performance, and scale down during off-peak periods to release idle resources.

Warning

Proceed with caution:

  • When you delete a serverless scheduled policy, running tasks within the current policy cannot be canceled, but tasks that have not yet been executed will be deleted.

  • If you disable the serverless feature while the serverless cluster is running, scheduled policies and scheduled tasks will be deleted.

  1. In the Configure Serverless-related Parameters dialog box, click + Add Scheduled Policy. The parameters are described as follows:

    Parameter

    Value

    Maximum Resources for Single Node (maximum)

    1 to 32 PCU.

    Minimum Resources for Single Node (minimum)

    1 to 32 PCU. The minimum value must be less than or equal to the maximum value.

    Maximum Read-only Nodes

    0 to 15.

    Minimum Read-only Nodes

    0 to 15. The value cannot be greater than the value of Maximum Read-only Nodes.

    Number of IMCI Read-only Nodes

    0 to 15.

    Start/End Time

    The effective time range of the scheduled policy.

    Policy scheduling

    The schedule settings for the scheduled policy.

    1. Monthly: select specific days and a time in Positive or Last for execution. Separate multiple days with a comma (,), for example, 1,3,5).

    2. Weekly: select specific days of the week (Monday to Sunday) and a time for execution.

    3. Daily: select a specific time of day for execution.

    Note

    After you configure a scheduled policy, the system adjusts the serverless configuration parameters of the cluster according to the policy scheduling time within the specified Start/End Time. After the adjustment is complete, the serverless configuration parameters of the cluster are not automatically restored. To restore the original configuration parameters at a specific time, configure another scheduled policy. For a detailed example, see Example.

  2. (Optional) View the execution plan. You can view it in two ways:

    Note

    Scheduled policies and scheduled tasks have a derivation relationship. After a scheduled policy is created, scheduled tasks are generated based on the policy.

    • After a scheduled policy is created, you can view it on the cluster details page.

      In the Pending Scheduled and Failed Retry Tasks section at the bottom of the cluster details page, you can view the task records generated by the scheduled policy, including the task ID, task status, task action (such as ModifyDBClusterServerlessConf), planned start time, and planned end time. You can also Cancel or Modify Planned Time for a task.

    • Go to Task Management > Scheduled Tasks in the console.

      In the task list on this page, you can view the status of each scheduled task (such as Pending or Cancel) and Cancel tasks that are in the Pending state.

Example

Scenario: If you want to scale up resources to 5 PCU at 9:30 AM and scale down to 1 PCU at 10:00 PM on every workday (Monday to Friday) from August 1 to September 30, configure the scheduled policy as shown in the following table:

Set both Maximum Resources for Single Node and Minimum Resources for Single Node to 5 PCU. Set both Maximum Number of Read-only Nodes and Minimum Number of Read-only Nodes to 5. After the configuration is complete, click OK.

In the scheduled policy configuration, set both Maximum Resources for Single Node and Minimum Resources for Single Node to 1 PCU, and set both Maximum Number of Read-only Nodes and Minimum Number of Read-only Nodes to 1. Click OK to complete the scale-down policy configuration.

FAQ

Do serverless read-only nodes include IMCI read-only nodes?

No. Regular read-only nodes and IMCI read-only nodes are two types of independent nodes and are created and managed separately.

Dimension

Regular read-only nodes

IMCI read-only nodes

Creation method

Created by default for a serverless cluster.

You must explicitly enable the IMCI feature.

Number of nodes

Auto scaling, controlled by Minimum Number of Read-only Nodes and Maximum Number of Read-only Nodes.

Fixed number, does not automatically increase or decrease, controlled by Number of IMCI Read-only Nodes.

PCU elasticity

0.25 to 32 PCU.

0.25 to 32 PCU.

When you configure a serverless cluster, Minimum Number of Read-only Nodes and Maximum Number of Read-only Nodes control the auto scaling of regular read-only nodes, and Number of IMCI Read-only Nodes controls the fixed number of IMCI read-only nodes. The PCU of each node for both node types scales elastically within the configured range.