Serverless FAQ

更新时间:
复制 MD 格式

This topic provides answers to frequently asked questions about Serverless clusters.

PolarDB Serverless FAQ

Basic concepts

What types of PolarDB Serverless are available?

PolarDB Serverless is available in the following two types:

  • Elastic-mode Serverless (also referred to as a Serverless cluster): The cluster specifications scale up and down dynamically between the configured upper and lower limits based on the workload. This type is suitable for scenarios with significant workload fluctuations. For more information, see Create a serverless cluster.

  • Stable-mode Serverless (the Serverless feature enabled on a cluster with fixed-specification nodes): The fixed-specification portion never scales in, which ensures business stability. The Serverless elastic portion scales up and down within seconds based on the workload. This type is suitable for scenarios with relatively stable workloads but occasional bursts. For more information, see Enable serverless for defined-specification clusters.

What does PCU mean for a Serverless cluster?

PCU stands for PolarDB Capacity Unit. One PCU is roughly equivalent to the standard capacity of one CPU core and 2 GB of memory. PCU is the unit used to manage the elastic compute resources of a PolarDB Serverless cluster. The minimum scaling unit is 0.5 PCU.

What is the maximum storage capacity of a PolarDB Serverless cluster?

The maximum storage capacity of a Serverless cluster depends on the storage type:

  • PSL4/PSL5: 100 TB.

  • ESSD: 64 TB.

Does a PolarDB Serverless cluster have a storage hot standby cluster?

Yes.

Scalability

What is the elasticity range of PolarDB Serverless?

The maximum elasticity range allowed for a single node (RW or RO) is 1 to 32 PCUs (approximately 32 cores and 64 GB of memory). The maximum number of RO nodes depends on your cluster edition. Enterprise Edition allows up to 15 additional RO nodes, and Standard Edition allows up to 7:

  • Enterprise Edition: The theoretical maximum compute capacity of the entire cluster is 32 × 16 = 512 PCUs.

  • Standard Edition: The theoretical maximum compute capacity of the entire cluster is 32 × 8 = 256 PCUs.

You can configure the per-node elasticity range and the number of RO nodes for a Serverless cluster in the console. For more information, see Configure serverless cluster scaling.

How long does scaling take in a PolarDB Serverless cluster?

In-place scaling on a single node of a Serverless cluster completes within 12 seconds. The total scaling time consists of three phases: detection, decision, and execution. Detection takes 10 seconds, while decision and execution each take less than 1 second. When a single node of the Serverless cluster reaches its configured upper limit (for example, the per-node elasticity range is set to 1 to 16 PCUs and the RW node reaches the 16 PCU upper limit) and the current workload still exceeds the cluster's processing capacity, the Serverless cluster automatically adds an RO node (within the configured maximum number of RO nodes). Adding an RO node takes about 1 minute. When the workload decreases and an RO node becomes idle, it is automatically removed.

What metrics trigger scale-up in a PolarDB Serverless cluster?

Triggers for scaling up and scaling out
  • Scale-up (upgrading nodes)

    PolarDB monitors CPU usage, memory usage, and other kernel-level metrics of compute nodes. A scale-up is triggered during a monitoring period if any of the following conditions is met:

    • The CPU usage is higher than the preset threshold (default: 85%).

    • The memory usage is higher than 85%.

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

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

  • Scale-out (adding nodes)

    If a read-only node reaches its configured scaling limit but still meets scale-up conditions (for example, CPU usage exceeds the threshold), a scale-out adds more read-only nodes.

Triggers for scaling down and scaling in
  • Scale-down (downgrading nodes)

    A scale-down is triggered when CPU usage falls below the preset threshold (default: 55%) and memory usage drops below 40%.

  • Scale-in (removing nodes)

    A scale-in removes a read-only node if its CPU usage stays below 15% and all other read-only nodes stay below 60% for 15 to 30 minutes.

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

    • To immediately remove all read-only nodes, modify the Serverless Configuration. Set both the Maximum Read-only Nodes and Minimum Read-only Nodes to 0. This action immediately triggers the removal of all read-only nodes.

Note

The thresholds described are default values. They may vary depending on the cluster's kernel parameters and Serverless configuration policies.

What does it mean that the scaling step grows with the PCU value in a PolarDB Serverless cluster?

When the workload of a Serverless cluster spikes, the cluster does not scale up to the target specification in one go. Instead, it scales up step by step to approach the specification required by the current workload. The minimum scaling step is 0.5 PCU. To adapt to the workload faster, the next scaling step is automatically adjusted based on the current PCU value, and the step grows as the PCU value increases.

Can the upper and lower PCU limits of a single node be set to the same value?

Yes. However, if you set the upper and lower PCU limits of a single node to the same value, the Serverless cluster does not scale up when the workload spikes, which may degrade your business. We recommend that you set a reasonable PCU elasticity range for each node.

What is the maximum number of connections for a PolarDB Serverless cluster?

Maximum connection limit: To prevent connection spikes from exhausting cluster resources within the resource detection window, the actual maximum number of available connections in a Serverless cluster scales dynamically with the real-time PCU. The rules vary by Serverless type:

  • Serverless cluster (elastic mode): The maximum number of connections depends only on the current PCU. The values are 150 when PCU<1, 200 when PCU=1, PCU × 187.5 when 1<PCU<17, and a fixed 3200 when PCU≥17.

  • Fixed-specification cluster with Serverless enabled (stable mode): The maximum number of connections consists of a fixed base part and an elastic part, and the formula varies by total memory. The base formulas are:

    • BaseConn = (BaseCPU + BaseMEM) × 100

    • TotalMEM = BaseMEM + PCU × 2

    where BaseCPU is the base CPU count, BaseMEM is the base memory size in GB, and TotalMEM is the total memory size.

Click to expand for detailed thresholds and a calculation example

Serverless cluster (elastic mode) — PCU to maximum connections mapping

PCU range

Maximum connections

PCU<1

150

PCU=1

200

1<PCU<17

PCU×187.5

PCU≥17

3200

Fixed-specification cluster with Serverless enabled (stable mode) — TotalMEM thresholds

TotalMEM range

Composition

Formula

TotalMEM≤4 GB

Base + elastic

BaseConn + PCU×300 − 100

4 GB<TotalMEM≤8 GB

Base + elastic

BaseConn + PCU×300 − 200

8 GB<TotalMEM≤16 GB

Base + elastic

BaseConn + PCU×300 − 400

16 GB<TotalMEM<96 GB

Fixed value

3200

96 GB≤TotalMEM<256 GB

Fixed value

12800

256 GB≤TotalMEM<512 GB

Fixed value

25600

TotalMEM≥512 GB

Fixed value

36000

Calculation example

Assume a fixed specification of 2 cores 4 GB (that is, BaseCPU=2, BaseMEM=4 GB) with Serverless elastic PCU=1. The calculation is as follows:

  • TotalMEM = 4 + 1×2 = 6 GB, which falls in the 4 GB<TotalMEM≤8 GB range.

  • BaseConn = (2 + 4) × 100 = 600.

  • Actual maximum available connections: 600 + 1×300 − 200 = 700.

Other

How do I migrate a provisioned PolarDB cluster to a Serverless cluster?

To migrate a provisioned PolarDB cluster to a Serverless cluster, use Data Transmission Service (DTS).