PolarDB provides a serverless compute package that offsets the cost of dynamic resources used by compute nodes for serverless clusters and the serverless feature of fixed-spec clusters, reducing your costs.
Notes
-
Purchasing or unsubscribing from a serverless compute package only affects billing and does not interrupt your service.
-
A serverless compute package is not region-specific and automatically covers the cost of dynamic resources for compute nodes in serverless clusters and for the serverless feature of fixed-specification clusters across all regions.
-
If the remaining capacity in your serverless compute package is insufficient, any excess usage of dynamic compute node resources is charged at the pay-as-you-go rate.
-
You cannot renew, upgrade, or downgrade serverless compute packages. If a serverless compute package has insufficient capacity, is expiring, or has expired, you can purchase a new serverless compute package, and its capacity is combined with that of any existing packages.
-
After you purchase a serverless compute package, dynamic resource usage for compute nodes in serverless clusters and for the serverless feature of fixed-specification clusters is no longer billed hourly; instead, this usage is measured in PolarDB Capacity Units (PCUs) and deducted hourly from the serverless compute package.
Pricing
Serverless compute packages are priced uniformly at CNY 0.38 per PCU per hour in all regions, including the Chinese mainland, China (Hong Kong), and overseas regions. This is 95% of the standard serverless rate in the Chinese mainland. Deduction factors vary by region. See the deduction table below for details.
Compute package capacity
-
30 to 5,000 PCU-hours
-
5,000 to 100,000 PCU-hours
-
100,000 to 1,000,000 PCU-hours
Deduction rules
-
PCU usage for all nodes in a cluster is deducted hourly.
-
For each node, the amount deducted (CU*H) per interval is calculated using the following formula: PCU count * (deduction factor * time factor). The time factor is the duration in seconds divided by 3600.
-
Within an hour, a deduction is made from the Serverless compute package each time the PCU count of a node changes. If the PCU count of the node does not change within the hour, one deduction is made from the Serverless compute package based on the node's current PCU count.
-
For each node, the sum of its time factors over a one-hour period is 1. This ensures that the total hourly deduction is calculated using the full regional deduction factor.
Example 1: PCU count remains unchanged within one hour
Consider a cluster in the Chinese mainland, where the regional deduction factor is 1. The Serverless configuration is set with a minimum resources per node of 1 PCU and a minimum number of read-only nodes of 1. If the cluster has no active connections during a one-hour period, it will have one primary node (1 PCU) and one read-only node (1 PCU). According to the deduction rules, the total deducted usage for the cluster in that hour is calculated as follows: the primary node usage (1 (PCU count) * 1 (deduction factor) * 1 (time factor)) plus the read-only node usage (1 (PCU count) * 1 (deduction factor) * 1 (time factor)), totaling 2 CU*H.
Example 2: PCU count changes within one hour
Consider a cluster in China (Hong Kong), where the regional deduction factor is 1.9. The Serverless configuration is set with a minimum resources per node of 1 PCU, a maximum resources per node of 16 PCU, a minimum number of read-only nodes of 1, and a maximum number of read-only nodes of 4. If the cluster workload increases during an hour, the PCU count for its nodes changes as follows:
|
Node |
PCU count |
Duration (seconds) |
Deduction (CU*H) |
|
primary node |
1 |
2700 |
1.425 = 1 (PCU count) * 1.9 (deduction factor) * 2700 / 3600 (time factor) |
|
1.5 |
90 |
0.07125 = 1.5 (PCU count) * 1.9 (deduction factor) * 90 / 3600 (time factor) |
|
|
2 |
90 |
0.095 = 2 (PCU count) * 1.9 (deduction factor) * 90 / 3600 (time factor) |
|
|
2.5 |
90 |
0.11875 = 2.5 (PCU count) * 1.9 (deduction factor) * 90 / 3600 (time factor) |
|
|
3 |
90 |
0.1425 = 3 (PCU count) * 1.9 (deduction factor) * 90 / 3600 (time factor) |
|
|
3.5 |
540 |
0.9975 = 3.5 (PCU count) * 1.9 (deduction factor) * 540 / 3600 (time factor) |
|
|
read-only node (no horizontal scaling) |
1 |
2700 |
1.425 = 1 (PCU count) * 1.9 (deduction factor) * 2700 / 3600 (time factor) |
|
1.5 |
180 |
0.1425 = 1.5 (PCU count) * 1.9 (deduction factor) * 180 / 3600 (time factor) |
|
|
2 |
180 |
0.19 = 2 (PCU count) * 1.9 (deduction factor) * 180 / 3600 (time factor) |
|
|
2.5 |
540 |
0.7125 = 2.5 (PCU count) * 1.9 (deduction factor) * 540 / 3600 (time factor) |
Based on the table, the cluster's total deducted usage for this hour is the sum of the primary node's usage (1.425 + 0.07125 + 0.095 + 0.11875 + 0.1425 + 0.9975) and the read-only node's usage (1.425 + 0.1425 + 0.19 + 0.7125), totaling 5.32 CU*H.
Deduction table
Application order
If you purchase multiple Serverless compute packages, the Serverless compute packages are deducted in order of their expiration time from earliest to latest. If the expiration time is the same, the Serverless compute package that was purchased first is deducted first.
Best practice
This example shows how to estimate the required capacity for a serverless computing package.
-
Example PolarDB requirements:
-
Region: A region in the Chinese mainland.
-
Clusters:
-
Clusters A, B, and C: One primary node (2 PCU) and one read-only node (2 PCU).
-
Cluster D: One primary node (4 PCU) and two read-only nodes (4 PCU each).
-
Cluster E: One primary node (2 PCU) and two read-only nodes (4 PCU each).
-
NoteIn this example, the cluster workloads are stable, and node PCU counts do not change.
-
-
Estimated PCU consumption:
Required capacity = (Total node PCUs) × deduction factor × number of hours
-
Clusters A, B, and C
4 PCU (2 PCU + 2 PCU) × 1 (deduction factor) × 24 (hours) × 3 (clusters) = 288 PCU.
-
Cluster D
12 PCU (4 PCU + 8 PCU) × 1 (deduction factor) × 24 (hours) = 288 PCU.
-
Cluster E
10 PCU (2 PCU + 8 PCU) × 1 (deduction factor) × 24 (hours) = 240 PCU.
In this example, the estimated daily consumption is 816 PCU (288 PCU + 288 PCU + 240 PCU), and the estimated monthly consumption is 24,480 PCU (816 PCU × 30). To account for potential workload fluctuations, consider adding a buffer of approximately 5%. Therefore, a serverless computing package with a capacity of 25,704 PCU (24,480 PCU × 1.05) is sufficient for one month.
-