You can enable the serverless feature for an existing cluster that uses the subscription or pay-as-you-go billing method. This topic describes how to enable the serverless feature for an existing cluster with defined specifications.
Supported versions
To enable the serverless feature for an existing cluster with defined specifications, make sure that the cluster meets the following version requirements:
Database engine version
PolarDB for MySQL 5.6: Not supported.
PolarDB for MySQL 5.7: The revision version must be 5.7.1.0.29 or later.
PolarDB for MySQL 8.0.1: The revision version must be 8.0.1.1.30.1 or later.
PolarDB for MySQL 8.0.2: The revision version must be 8.0.2.2.19 or later.
PolarProxy version
PolarDB PolarProxy 2.4.30 or later.
Limits
You cannot enable the serverless feature for a single-node cluster for which PolarProxy is not configured. To enable the serverless feature for such a cluster, add read-only nodes to the cluster. For more information, see Add a read-only node. You can enable the serverless feature for a new single-node cluster that meets the version requirements.
The following feature is not supported: Manually scale up or scale down storage capacity (for Enterprise Edition)
The serverless feature is available for X-Engine Edition clusters that meet the following requirements:
PolarDB for MySQL 8.0.1 whose revision version is 8.0.1.1.41 or later.
PolarDB for MySQL 8.0.2 whose revision version is 8.0.2.2.23 or later.
Global Database Network (GDN) is supported, but is subject to the following limits:
Automatic start and stop cannot be enabled on all serverless clusters in a GDN.
Each serverless cluster in the GDN must have at least one read-only node if the cluster meets the following requirements:
PolarDB for MySQL 8.0.1 whose revision version is 8.0.1.1.42 or later.
PolarDB for MySQL 8.0.2 whose revision version is 8.0.2.2.23 or later.
Auto scaling of local resources and Auto scaling for clusters that do not support serverless. If the Serverless feature is enabled on a cluster with defined specifications, you cannot enable these features. Similarly, after you enable these features on a cluster with defined specifications, you cannot enable the serverless feature.
To enable the serverless feature on column store nodes in an existing cluster with defined specifications, add read-only column store nodes to the cluster. After you add read-only column store nodes, you can configure the maximum number of serverless read-only column store nodes that can be added.
PolarDB capacity unit (PCU) scaling of a compute node in a serverless cluster with defined specifications is subject to the following limits:
PCU scaling is not supported for a compute node with dedicated specifications that has more than 32 CPU cores.
PCU scaling is not supported for a compute node with general-purpose specifications that has more than 16 CPU cores.
Usage notes
After you enable the serverless feature for an existing cluster with defined specifications, the maximum number of connections and the maximum IOPS of the cluster are proportional to the value of the Maximum Resources for Single Node parameter.
When you enable the serverless feature for an existing cluster with defined specifications, the cluster may be migrated to an idle host due to shortage of host resources. We recommend that you enable the serverless feature during off-peak hours.
NoteIf you use the primary endpoint to connect to the cluster, a disconnection of 5 to 10 seconds occurs during cluster migration.
If you use a cluster endpoint to connect to the cluster, no disconnection occurs during cluster migration. We recommend that you use a cluster endpoint to connect to the cluster and make sure that the failover with hot replica feature takes effect. For more information, see Endpoints and Imperceptible failover within seconds.
After you enable the serverless feature, the values of parameters such as
innodb_buffer_pool_size
,loose_thread_pool_size
, andtable_open_cache
are dynamically adjusted. When you disable the serverless feature, the parameter values are restored to those before the serverless feature is enabled.
Architecture
Note The maximum number of connections to a serverless cluster is 100,000, and the maximum IOPS of a serverless cluster is 84,000. |
Pricing
The fees of a serverless-enabled cluster with defined specifications consist of the fees for the cluster with defined specifications and the fees related to the serverless feature. For information about the fees of a cluster with defined specifications, see Billable items. For information about the fees related to the serverless feature, see Billing.
Procedure
You can enable the serverless feature for a cluster with defined specifications by using one of the following methods:
Log on to the PolarDB console. In the left-side navigation pane, click Clusters. In the upper-left corner, select the region in which the cluster is deployed. In the cluster list, click the ID of the cluster to go to the Basic Information page of the cluster.
In the Database Nodes section of the Basic Information page, click Enable Serverless.
In the Enable Serverless dialog box, configure the parameters and click OK. The following table describes the parameters.
Maximum Resources for Single Node: The maximum number of PCUs to which a node in the cluster with fixed specifications can be scaled up, as shown in the "Architecture" section of this topic. Valid values: 0 to 16. Unit: PCUs.
Minimum Resources for Single Node: The minimum number of PCUs to which a node in the cluster of fixed specifications can be scaled down, as shown in the "Architecture" section of this topic. Valid values: 0 to 16. Make sure that the minimum value is less than or equal to the maximum value.
NoteThe parameter value does not include the defined specifications in the cluster. After you configure the parameters, a node in the cluster can be scaled within the following range: (Defined specifications + Specified lower limit) to (Defined specifications + Specified upper limit).
The default scaling range of an automatically added read-only node is from 1 PCU to 32 PCUs. You do not need to specify the range.
Example: If you set the Minimum Resources for Single Node parameter to 2 PCUs and the Maximum Resources for Single Node parameter to 8 PCUs, the original resource specifications of a node in the cluster are the defined specifications plus 2 PCUs (2 CPU cores and 4 GB memory). When the business load increases, the system automatically increases the number of PCUs of the node. However, the maximum number of PCUs can only be increased to 8 (approximately equal to 8 CPU cores and 16 GB memory) based on the settings. The resource specifications of a node in the cluster can be increased to the defined specifications plus 8 PCUs (approximately equal to 8 CPU cores and 16 GB memory).
Maximum Read-only Nodes: the maximum number of read-only nodes that can be added. Valid values: 0 to 15.
Minimum Read-only Nodes: the minimum number of read-only nodes that can be added. Valid values: 0 to 15. The value cannot exceed the upper limit.
NoteThe parameter value does not include the number of original read-only nodes in the cluster.
If no read-only column store node exists in the cluster, this parameter is not displayed.
Example: If you set the Minimum Number of Read-only Nodes parameter to 1 and the Maximum Number of Read-only Nodes parameter to 2, only one read-only node can be added to the cluster. When the business load increases, the system automatically increases the number of read-only nodes. However, you can add up to two read-only nodes based on the original number of read-only nodes.
Read-only Column Storage Nodes: the number of read-only column store nodes that can be added to the cluster. Valid values: 0 to 15.
NoteThe parameter value does not include the number of original read-only column store nodes in the cluster.
If no read-only column store node exists in the cluster, this parameter is not displayed.
NoteA cluster can contain up to 15 read-only nodes. Make sure that the sum of the numbers of original read-only nodes, automatically added read-only nodes, and read-only column store nodes in a cluster does not exceed 15.
References
Related API operations
API | Description |
Enables the serverless feature for a cluster with defined specifications | |
Queries the serverless configuration of a cluster. |