Enable serverless for read-only IMCI nodes
This topic describes how to enable the serverless feature for read-only IMCI nodes.
Prerequisites
Your PolarDB for MySQL cluster must be Enterprise Edition, run kernel version 8.0, and have at least one read-only IMCI node.
Implementation models
-
Set a scaling range for a read-only IMCI node with a fixed specification: This adds serverless capabilities to a node with a fixed specification. The fixed specification provides baseline processing power, and resources scale up temporarily to handle workloads that exceed this baseline.
-
Create a read-only IMCI node without a fixed specification: The node's resources scale on demand based on the workload. This model is ideal for cost-sensitive business scenarios.
Benefits
Cost reduction for peak and off-peak cycles
The serverless architecture excels at handling fluctuating workloads. It automatically scales down resources during off-peak periods and scales them up during peak periods to reduce costs. For example, consider a day with 12 peak hours that require a 32-core, 64 GB configuration and 12 off-peak hours that only require a 16-core, 32 GB configuration. A serverless architecture based on the 16-core, 32 GB specification can reduce compute node costs by 25% compared to running the 32-core, 64 GB configuration continuously.
Optimizations for the serverless architecture
In-Memory Column Index (IMCI) includes several optimizations to improve performance and user experience in a serverless architecture:
-
Resource utilization optimization: Read-only IMCI nodes feature a comprehensive resource management mechanism that supports online configuration of key system parameters, such as cache, thread pools, and execution memory. In a serverless architecture, the system automatically adjusts these parameters when resources scale up or down to ensure maximum resource utilization.
-
SQL queuing optimization: Read-only IMCI nodes are primarily used for analytical scenarios. To run complex SQL queries quickly, more resources are typically allocated to each complex query. An increase in the number of complex queries can strain system resources, blocking subsequent simple SQL queries. This leads to slow SQL due to queuing. In a serverless architecture, a read-only IMCI node automatically increases resources based on the SQL queuing status to mitigate slow SQL caused by queuing.
NoteThis optimization is available in the following kernel versions:
-
For PolarDB for MySQL 8.0.1, the minor version must be 8.0.1.1.39 or later.
-
For PolarDB for MySQL 8.0.2, the minor version must be 8.0.2.2.20 or later.
-
-
Faster index loading on startup: After a cluster restart, a read-only IMCI node must rebuild its internal index metadata, which typically takes several minutes. During this period, the In-Memory Column Index (IMCI) is unavailable. In a serverless architecture, the read-only IMCI node uses elastic resources to accelerate this rebuilding process, making it available sooner.
NoteThis optimization is available in the following kernel versions:
-
For PolarDB for MySQL 8.0.1, the minor version must be 8.0.1.1.36 or later.
-
For PolarDB for MySQL 8.0.2, the minor version must be 8.0.2.2.20 or later.
-
-
Accelerated log replay: The In-Memory Column Index (IMCI) is built from physical log replay. However, because the system allocates most of its resources to support SQL queries, resources for building the column index can be insufficient. This can increase log replay latency for the column index. This latency may cause queries to be routed to other nodes or wait for log replay to complete, resulting in slow SQL. In a serverless architecture, the read-only IMCI node automatically increases resources for replay to accelerate log replay.
NoteThis optimization is available for PolarDB for MySQL 8.0.1. The minor version must be 8.0.1.1.45 or later.
-
Accelerated DDL execution: Performing DDL operations on an In-Memory Column Index (IMCI) can be time-consuming. In a serverless architecture, the read-only IMCI node adaptively increases thread resources to accelerate DDL execution.
NoteThis optimization is available in the following kernel versions:
-
For PolarDB for MySQL 8.0.1, the minor version must be 8.0.1.1.44 or later.
-
For PolarDB for MySQL 8.0.2, the minor version must be 8.0.2.2.25 or later.
-
Procedure
Set scaling range for fixed-spec IMCI nodes
Log on to the PolarDB console.
In the upper-left corner, select the region where the cluster is deployed.
Find the target cluster and click its ID.
-
On the Basic Information page, in the Database Nodes section, click Enable Serverless.
-
In the Enable Serverless dialog box, set Maximum Resources for Single Node and Minimum Resources for Single Node. For more information about Maximum Resources for Single Node and Minimum Resources for Single Node, see Enable the serverless feature for clusters with fixed specifications.
-
Click OK.
After the settings are applied, the read-only IMCI node can dynamically scale in addition to its original fixed specification.

Create a serverless-only IMCI node
Log on to the PolarDB console.
In the upper-left corner, select the region where the cluster is deployed.
Find the target cluster and click its ID.
-
On the Basic Information page, in the Database Nodes section, click Enable Serverless.
-
In the Enable Serverless dialog box, set the number of Read-only IMCI Nodes and click OK. In this example, one read-only IMCI node is created.
After the settings are applied, PolarDB automatically creates a read-only IMCI node that dynamically scales from 1 to 16 PolarDB Capacity Units (PCUs).
