Free from fixed specifications, serverless ApsaraDB RDS for MySQL (RDS for MySQL) instances offer two key advantages for cost-efficiency and performance: auto scaling and automatic start/stop. In these instances, computing and storage resources scale automatically with your business needs, while idle instances are suspended to halt computing charges. This ensures you only pay for what you use, precisely when you use it.
Feature overview
A serverless RDS for MySQL instance is defined by two core features that deliver its primary benefits: auto scaling and automatic start/stop.
Auto scaling
Auto scaling applies to both computing and storage. Computing resources scale with workload, while storage expands as data grows.
Computing resources
Serverless RDS instances measure computing resources in RDS Capacity Units (RCUs), where one RCU provides approximately 1 vCPU and 2 GB of memory. You can define a scaling range by setting the minimum and maximum RCUs, and the instance's performance scales automatically within that range to match your workload. The advantage of this approach becomes clear with fluctuating workloads:
Regular instances (fixed specifications): You face a trade-off between wasted resources during off-peak hours and performance bottlenecks at peak times.
Serverless instances (no fixed specifications): The instance's performance dynamically matches the workload. It scales up to ensure business stability during peak demand and scales down to save costs when idle, maximizing resource utilization.

Storage
Automatic expansion: Storage capacity automatically expands when more space is needed, requiring no manual intervention.
Manual shrink: To ensure instance stability and data security, automatic storage shrinking is not supported. However, you can manually shrink storage capacity based on your business needs.
Automatic start/stop
You can enable automatic start/stop (disabled by default) for workloads that are not always active, such as in development and testing environments. This feature automatically suspends the instance after a period of inactivity and restarts it upon receiving a connection request, significantly reducing costs. The process is governed by these rules:
Automatic suspend: An instance is automatically suspended after 10 minutes of inactivity (no connections).
Automatic start: The instance restarts automatically upon any connection request. The startup process takes 6 to 40 seconds, during which the instance is unavailable.
Cost savings: While an instance is suspended, you are billed only for storage, not for computing resources.
Use cases
Workloads with significant peaks and troughs.
Infrequently used databases, such as in development and testing environments.
Intermittent or scheduled tasks, like those for online courses or student labs.
Unpredictable workloads, common in IoT and edge computing.
Limitations
Regions: Serverless RDS for MySQL instances are available only in the following regions:
China (Hangzhou), China (Shanghai), China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Ulanqab), China (Shenzhen), China (Heyuan), China (Guangzhou), China (Chengdu), China (Hong Kong), Singapore, US (Virginia), US (Silicon Valley), Germany (Frankfurt), UK (London), Thailand (Bangkok), South Korea (Seoul), Philippines (Manila), Japan (Tokyo), Malaysia (Kuala Lumpur), Indonesia (Jakarta)
Editions: Only Basic Edition and High-availability Edition are supported.
Storage type: Only PL1 ESSD is supported.
RCU range: 0.5 RCU (min) to 32 RCU (max), with a scaling step of 0.5 RCU.
Storage capacity: 20 GB (min) to 32 TB (max).
Storage shrink: Shrinking can only be manually performed. The minimum capacity after a shrink is
min{Current data volume * 1.3, Current data volume + 400 GB}. The new capacity cannot be less than the minimum capacity defined in the instance type.Instance start/stop: When automatic start/stop is enabled, the instance can be automatically suspended, and can be automatically or manually started. Manual suspension is not supported.
Billing
Serverless instances are billed on an hourly basis. Visit the Expenses and Costs page to view your billing details.
Cost breakdown
The total cost of a serverless instance is calculated as follows:
Total cost = Cost per node × Number of nodes
Number of nodes: A Basic Edition instance has one node. A High-availability Edition instance has two.
Cost per node: This includes the costs for both computing and storage resources.
Computing resource cost
The cost for computing resources is billed hourly and calculated as follows:
Hourly computing resource cost = RCU unit price × Hourly RCU usageHourly RCU usage: This is the average number of RCUs used per second over the course of an hour.
RCU price: The unit price for RCUs varies by region. For example, in the Singapore region, the price is
USD 0.07455 per RCU-hour. For prices in other regions, refer to the RDS buy page.
Storage cost
The cost for storage is billed hourly based on the following formula:
Hourly storage cost = Storage price × Storage capacity (GB)Storage capacity (GB): Find the current storage capacity of your instance on the Instance Details page by accessing .
Storage price: The unit price for storage varies by region. For example, in the Singapore region, the price is
USD 0.0004 per GB-hour. For prices in other regions, refer to the RDS buy page.
How instance states affect billing
When automatic start/stop is enabled, the instance state changes as it suspends and restarts, directly impacting your costs. The lifecycle of an instance, its corresponding states, and their billing implications are as follows:
Initial state: The instance is active and fully operational.
State: Running
Trigger for suspension: After 10 minutes of inactivity (no connections), the instance begins to suspend.
State: Suspending
Suspended state: The instance is fully suspended and idle.
State: Suspended
Trigger for start: Upon receiving a new connection request, the instance begins to restart.
State: Starting
Return to initial state: The instance becomes fully operational again.
State: Running
Instance state | Computing resources (RCUs) | Storage |
Suspending | Billed | Billed |
Suspended | Not billed | Billed |
Starting | Not billed | Billed |
Running | Billed | Billed |
Billing example
Consider the following scenario for a 24-hour period:
Instance: Serverless RDS instance on Basic Edition
Region: Singapore
Storage capacity: 20 GB
Usage pattern:
1 hour at peak usage (8 RCUs)
23 hours at base usage (1 RCU)
Based on the prices for the Singapore region:
RCU price: USD 0.07455 per RCU-hour
Storage price: USD 0.0004 per GB-hour
The total cost for the day is calculated as follows:
RCU cost:
(0.07455 × 8 RCUs × 1 hour) + (0.07455 × 1 RCU × 23 hours) = USD 2.31105Storage cost:
0.0004 × 20 GB × 24 hours = USD 0.192Total daily cost:
USD 2.31105 (RCU) + USD 0.192 (Storage) = USD 2.50305
Create a serverless instance
You can get a serverless instance in two ways: convert an existing pay-as-you-go instance, or create a new one. This section guides you how to create a new serverless instance.
Navigate to the RDS buy page and set Billing Method to Serverless.
Configure basic instance information.
Region: Select a region for the instance.
ImportantThe region cannot be changed after the instance is created.
For internal access from an ECS instance, select the same region as the ECS instance to ensure low-latency communication.
For external access, select a region geographically close to your users to reduce network latency
Database Engine: Select MySQL 5.7 or MySQL 8.0.
Configure instance architecture and storage.
Edition: Select the deployment mode of the instance.
Basic Edition: A single-node deployment suitable for development, testing, or scenarios with low availability requirements.
High-availability Edition: A primary/secondary dual-node deployment with automatic failover, suitable for production environments.
Storage Type: Select PL1 ESSD.
Configure auto scaling.
RDS Capacity Units (RCUs): Configure the minimum and maximum RCUs. The instance scales automatically within this range.
Scaling Policy: In rare cases where scaling cannot be smoothly performed, this policy determines the instance's behavior:
Execute Forcefully: Prioritizes performance by forcing the RCU scaling. This may cause a service switchover, so ensure your application can automatically reconnect to the instance.
Do Not Execute Forcefully: Prioritizes stability by deferring the scaling operation to maintain existing connections.
Automatic Stop and Restart: Enable this to allow the instance to automatically suspend when idle and restart on request. During suspension, you are only billed for storage.
Configure network and zone.
VPC: For internal communication, select the same VPC as your ECS instance.
Add to Whitelist: Enable this to allow all ECS instances within the same VPC to access the RDS instance directly.
Zone and Network of Primary Node: Select a primary zone. If you select High-availability Edition for Edition, you must also configure a secondary zone based on the value you select for Deployment Method.
Configure the storage capacity. The minimum adjustment step is 5 GB.
(Optional) Configure other parameters. Keep the default values if you have no special requirements.
Confirm the configuration and place the order.
To create multiple instances with the same configuration, configure Quantity in the upper-right corner (up to 20). Review your configuration and click Confirm Order.
View your instance.
After successful payment, navigate to the Instances page and select the region of your instance. The instance will appear with a Creating state, which takes about 10 minutes. The instance is ready when its status changes to Running.
NoteThere might be a short delay between payment and the instance appearing in the console. If it doesn't appear immediately, wait a few moments and refresh the page.
View RCU usage and storage capacity changes
You can view the changes in RCU usage and storage capacity over the past 30 days to determine if your auto scaling configuration needs adjustment.
Navigate to the Instances page, select the region of your instance from the top menu, and then click the ID of the instance.
In the left-side navigation pane, click Monitoring and Alerts.
On the Standard Monitoring tab, click Old Version in the upper-right corner.
On the Resource Monitoring tab, view the historical data for Database Capacity (RCUs) and Disk Space.
Adjust auto scaling settings
Adjust RCU range and scaling policy
Navigate to the Instances page, select the region of your instance from the top menu, and then click the instance ID.
In the Configuration Information section, click Adjust Elastic Settings.
In the panel that appears, modify the auto scaling settings:
RDS Capacity Units (RCUs): Adjust the minimum and maximum RCU values to better fit your workload.
Scaling Policy: Choose the instance's behavior for rare cases where scaling cannot be smoothly performed:
Execute Forcefully: Prioritizes performance by forcing the RCU scaling. This may cause a service switchover, so ensure your application can automatically reconnect to the instance.
Do Not Execute Forcefully: Prioritizes stability by deferring the scaling operation to maintain existing connections.
Click OK.
Manually adjust storage capacity
A serverless instance automatically expands its storage capacity when the available storage space is low. However, to ensure stability and data security, the instance does not automatically shrink its storage capacity. You can manually adjust the storage capacity by following these steps:
Navigate to the Instances page, select the region of your instance from the top menu, and then click the instance ID.
On the Basic Information page, in the Instance Resources section, click Modify next to Storage Capacity.
In the panel that appears, increase or decrease the storage capacity, click OK. Then, click Confirm in the dialog box that appears.
Shrinking the storage capacity takes longer than expansion because it requires data replication. During this process, the instance state will be Upgrading/Downgrading. After the operation is complete, the state will return to Running.
Manage instance start/stop
Enable or disable automatic start/stop
Navigate to the Instances page, select the region of your instance from the top menu, and then click the instance ID.
In the Configuration Information section, click Modify Scaling Settings.
Click Advanced Settings, select Enable or Disable from the Automatic Stop and Restart drop-down list, and click OK at the bottom of the page.
he instance takes approximately 6 to 40 seconds to restart from a suspended state. During this time (the Starting state), the instance is unavailable.
Manually start an instance
From the Instances page:
Navigate to the Instances page, select the region of your instance from the top menu.
In the Actions column for the instance, click More and then click Start Instance.
From the instance details page:
Navigate to the Instances page, select the region of your instance from the top menu, and then click the instance ID.
On the Basic Information page, in the Status section, click Start Instance.
View instance start/stop records
Navigate to the RDS console, click Task Center in the left-side navigation pane.
View the start/stop records (both automatic and manual) for the instance.
Upgrade an instance from Basic Edition to High-availability Edition
For better disaster recovery capabilities or advanced features, upgrade the edition of a serverless instance from Basic Edition to High-availability Edition.
Navigate to the Instances page, select the region of your instance from the top menu, and then click the instance ID.
In the Configuration Information section, click Modify Elastic Settings.
In the panel that appears, select High-availability Edition for Edition, and click OK.
In the dialog box that appears, check the information before and after the upgrade, and then click Confirm. During the upgrade, the instance status is Upgrading/Downgrading. After the upgrade is complete, the instance status changes to Running.
Schedule RCU configurations
The auto scaling of RCUs typically completes within seconds. However, it can take 3 to 5 minutes in rare cases that require cross-host scaling. If your application has strict stability requirements during specific periods, such as for anticipated traffic spikes, you can guarantee performance by scheduling an RCU increase in advance. For detailed instructions, see Configure scheduled tasks to adjust the number of RCUs for a serverless RDS instance.
FAQ
Q1: Why didn't my serverless instance suspend automatically? How do I check its current connections?
There are several common reasons for this. Please check the following in order:
Confirm the feature is enabled: The automatic start/stop feature is disabled by default. Ensure you have manually enabled it.
Check for active connections: The instance will only suspend if it has zero active connections. You can check connections in two ways:
To view the connection count: On the instance's Basic Information page, click Monitoring and Alerts in the left-side navigation pane. Then, check the Session metric on the Standard Monitoring tab.
To view connection details: Run the
SHOW PROCESSLISTcommand.
Review your whitelist settings: If your instance has a public endpoint and a whitelist open to all IP addresses, it may be receiving persistent external scans. This activity prevents the instance from suspending. Consider releasing the public endpoint or restricting the whitelist to trusted IP addresses only.
Q2: How long does RCU scaling take? What are the trigger conditions for RCU auto scaling?
Duration: RCU scaling is typically completed in real time (within seconds). In rare cases that require cross-host migration, it may take 3 to 5 minutes. Instances of the High-availability Edition are less likely to experience this delay due to their secondary node.
Trigger conditions:
Scale-up: Triggered when either CPU utilization or memory usage rises to its upper threshold.
Scale-down: Triggered when both CPU utilization and memory usage fall below their lower thresholds.
The thresholds typically range between 40% and 80% and may be adjusted by the system to ensure availability.
Q3: How do I choose the RCU scaling range?
You can use one of the following methods:
Perform a stress test to determine the number of RCUs or CPU cores required for your lowest and highest workloads.
Estimate the range based on the number of CPU cores required by your business. 1 RCU is approximately equal to 1 vCPU and 2 GB of memory.
Q4: Will I be charged if I'm not using my serverless instance?
This depends on whether automatic start/stop is enabled.
Enabled: If the instance has no connections for 10 minutes, it automatically suspends. In this state, you are billed only for storage.
Disabled: The instance remains in the
Runningstate regardless of usage. You are billed for both storage and computing resources. When idle, computing resources are typically billed based on your minimum RCU settings.
Q5: Is a High-availability Edition instance deployed in a single zone or multiple zones?
A High-availability Edition instance can be deployed in either a single zone or across multiple zones, based on the configuration you choose during creation.