The serverless feature provides dynamic scaling capabilities to PolarDB clusters. Each node in a cluster can be scaled up within seconds to handle sudden increases in workloads without affecting business operations. When workloads decrease, nodes can be scaled down to save costs.
With Serverless feature, you don't have to worry about the resource configuration of your database cluster when you create and use databases. The following section shows the changes in resource usage and specifications of a common cluster and a serverless cluster when your business fluctuates:
|
|
Features
The serverless feature provides real-time elasticity for CPU, memory, storage, and network resources. It offers vertical resource isolation for network resources and storage space. It also supports pay-as-you-go billing and the elastic allocation of computing and storage resources. This lets you quickly and independently adjust computing and storage capabilities during business peaks and troughs. This enables a rapid response to business changes while optimizing costs, which helps enterprises reduce expenses and improve efficiency.
Introduction | Description |
Display format |
|
Scaling method |
|
PCU (PolarDB Capacity Unit) | The serverless feature uses PolarDB Capacity Unit (PCU) as the unit of measurement for billing and resource elasticity on a per-second basis. One PCU is approximately equal to 1 CPU core and 2 GB of memory. The PCUs of a node are dynamically adjusted within the specified range based on the workloads. The minimum scaling increment is 0.5 PCU. |
Format
Serverless cluster | Serverless feature for clusters with defined specifications |
Note
|
Note
|
Scaling
Trigger conditions for scale-up and scale-out
Scale-up (node upgrade)
PolarDB monitors the CPU utilization, memory usage, and other kernel-level metrics of the primary and read-only nodes. During a monitoring cycle, a scale-up is typically triggered for a node when one of the following three situations occurs:
The CPU utilization is higher than the preset threshold (default 80%).
The memory usage is higher than 90%.
The specifications of a read-only node are less than half of the specifications of the primary node.
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.
Scale-out (add a node)
If a read-only node in a cluster is scaled up to its maximum specifications and the scale-up threshold is still met (for example, if the CPU utilization is higher than the custom threshold), a scale-out of read-only nodes is triggered.
Trigger conditions for scale-down and scale-in
Scale-down (node downgrade)
A scale-down is triggered for a node when its CPU utilization is below the custom threshold (default 50%) and its memory usage is below 80%.
Scale-in (remove a node)
A scale-in is triggered for a read-only node if its CPU utilization stays below 15% and the CPU utilization of all other read-only nodes stays below 60% for 15 to 30 minutes.
NoteTo prevent node jitter, only one read-only node is scaled in at a time. The quiescent period between consecutive scale-in activities is 15 to 30 minutes.
If you want to immediately scale in all read-only nodes, you can modify the Serverless Configuration. If you set both the Maximum Number of Read-only Nodes and Minimum Number of Read-only Nodes to 0, a scale-in of all read-only nodes is immediately triggered.
The scaling range is determined by the maximum and minimum number of read-only nodes and the maximum and minimum PCUs per node that you specify. For more information, see Set a scaling policy for serverless cluster resources or Set a scaling policy for serverless resources.
The metrics for triggering scaling vary based on parameter configurations and serverless configurations. You can specify a threshold for CPU utilization, but you cannot change the thresholds for other metrics.
When the service traffic of a cluster suddenly increases, the nodes of the cluster are scaled up incrementally to approach the expected specifications, instead of all at once. The minimum scaling increment is 0.5 PCU. To quickly adapt to the current service traffic, the next scaling increment is automatically adjusted based on the current number of PCUs.
You can configure alert rules in Performance Monitoring in the console to receive timely notifications when cluster nodes are scaled down. For more information about how to configure alert rules, see Create an alert rule.
Benefits
The serverless feature can dynamically scale cluster resources in seconds based on workloads. The serverless feature provides the following benefits:
High availability
The multi-node architecture ensures the high availability of serverless clusters. Serverless clusters offer the same service level agreement (SLA) as common clusters to ensure stability.
High scalability
Wide scaling range
A single cluster can be scaled between 0 and 1,000 CPU cores without interrupting business.
Scalability in seconds
Workload detection is accomplished in five seconds and cluster resources are scaled up within a second when your workloads increase. If your workloads decrease, cluster resources are automatically scaled down in a tiered manner.
No business interruption
The scaling process has no impact on business.
Strong data consistency
Global consistency (high-performance mode) is provided. Clusters support strong data consistency. Data can be read immediately after it is written to read-only nodes, while the performance is almost the same as in weak consistency mode.
Cost-effectiveness
Serverless clusters are billed in PCUs in the pay-as-you-go billing method. This reduces costs by up to 80%.
Zero O&M
The PolarDB serverless team is responsible for all operations and maintenance work, such as system upgrades, system deployment, scaling, and alert processing. These operations are performed in the background and do not affect the services that are running in the system. This ensures continuous service delivery and allows you to focus on developing your business.
Scenarios
Serverless clusters
Scenarios in which workloads fluctuate dramatically
Scenarios that require infrequent access to databases, such as databases in development and testing environments
Scenarios in which intermittent scheduled tasks are involved, such as teaching and student experiments
Scenarios that handle inconsistent and unpredictable workloads, such as IoT and edge computing
Scenarios that need to reduce O&M costs and improve O&M efficiency
Serverless clusters with defined specifications
Scenarios in which workloads fluctuate dramatically
Scenarios that handle inconsistent and unpredictable workloads, such as IoT and edge computing
Scenarios that need to reduce O&M costs and improve O&M efficiency
Scenarios that need to satisfy fluctuation requirements based on existing PolarDB clusters.
Prerequisites
Serverless clusters
Clusters whose database engine is MySQL 5.6 are not supported.
The serverless feature is unavailable for clusters whose CPU architecture is YiTian ARM.
Serverless feature for clusters with defined specifications
To enable the serverless feature for a cluster with defined specifications, make sure that the cluster meets the following version requirements:
Engine version:
MySQL 5.6: Not supported.
MySQL 5.7: The minor engine version must be 5.7.1.0.29 or later.
MySQL 8.0.1: The minor engine version must be 8.0.1.1.30.1 or later.
MySQL 8.0.2: The minor engine version must be 8.0.2.2.19 or later.
Database proxy (Proxy) version: Must be 2.4.30 or later.
CPU Architecture: Must be X86. YiTian ARM is not supported.
Limits
Serverless clusters
The following features are not supported:
Manual scale-out/scale-in of storage space for Enterprise Edition.
Standard Edition ESSD: Manual scale-in of storage space.
The global database network (GDN) feature is supported with the following limitations:
No-activity Suspension cannot be set for any cluster in the GDN.
When the database engine version meets the following conditions, all clusters in the GDN must have at least one read-only node:
MySQL 8.0.1 with a minor engine version earlier than 8.0.1.1.42.
MySQL 8.0.2 with a minor engine version earlier than 8.0.2.2.23.
The following features are also supported: Delete a node, Manually change specifications, Temporary upgrade, and Elastic scaling with auto scaling.
The In-Memory Column Index (IMCI) feature is supported, but you must ensure that the serverless cluster contains at least one read-only node. To do this, you must set the Minimum Number of Read-only Nodes for the serverless cluster to 1 before you can add a read-only column store node.
Serverless feature for clusters with defined specifications
Single-node clusters without a database proxy do not support the serverless feature because they do not meet the prerequisites. To enable the feature, add a read-only node. Newly purchased single-node clusters that meet the version requirements support the serverless feature by default.
Enterprise Edition: Manual scale up or down storage space is not supported.
The global database network (GDN) feature is supported with the following limitations:
No-activity Suspension cannot be set for any cluster in the GDN.
When the database engine version meets the following conditions, all clusters in the GDN must have at least one read-only node:
MySQL 8.0.1 with a minor engine version earlier than 8.0.1.1.42.
MySQL 8.0.2 with a minor engine version earlier than 8.0.2.2.23.
The serverless feature and the Elastic scaling with auto scaling feature are mutually exclusive. This means that on a cluster with defined specifications, you cannot enable the serverless feature if the Elastic scaling with auto scaling feature is enabled, and you cannot enable the Elastic scaling with auto scaling feature if the serverless feature is enabled.
For more information about version requirements and limits, see Enable the serverless feature for a cluster with defined specifications.
Pricing
Serverless clusters
The fees include compute node fees, storage space fees, backup storage fees (only for the part that exceeds the free quota), and SQL Explorer fees (optional). For more information, see Serverless billing.
You can view your bills on the Expenses and Costs page. On the Bill Details page, select PolarDB-Serverless from the Product Name drop-down list. For more information, see Bill details.
Serverless feature for clusters with defined specifications
The fees include the costs for resources with defined specifications and the costs for serverless resources. For more information about the costs for resources with defined specifications, see Billable items. For more information about the costs for serverless resources, see Billing.
