ApsaraDB RDS for MySQL Serverless

更新时间:
复制 MD 格式

Instead of using fixed specifications, an ApsaraDB RDS for MySQL Serverless instance auto-scales its computing resources within a range you specify based on your business workload, while its storage resources expand automatically as your data grows. This prevents idle resources and reduces operational costs. The instance also supports automatic start/stop. While the instance is stopped, you incur only storage charges, not computing charges.

Feature overview

A serverless RDS for MySQL instance has no fixed specifications. Compared with a regular instance, its key advantages are auto scaling and automatic start/stop. Instance performance scales up or down with the workload, and it automatically suspends after extended periods of inactivity. This design helps you meet peak demand, maximize resource utilization, and reduce costs.

Auto scaling

For a serverless instance, auto scaling means its computing resources scale with the workload and its storage expands as data grows.

Computing resources

A serverless instance uses RCU (RDS Capacity Unit) to measure computing resources: 1 RCU is approximately equivalent to 1 vCPU and 2 GB of memory. You can set the minimum and maximum values for auto scaling, and the instance performance automatically adjusts within the specified RCU range based on workload changes. Auto scaling is especially advantageous for workloads with significant fluctuations:

  • 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): Instance performance closely tracks the workload, scaling up during peak periods to meet demand and improve stability, and scaling down during off-peak periods to reduce costs and improve resource utilization.

资源对比

Storage

  • Automatic expansion: When storage space runs low, the system automatically expands it without requiring manual intervention.

  • Manual shrink: To ensure instance stability and data security, serverless instances do not support automatic storage shrinking. However, you can manually shrink storage capacity as needed.

Automatic start/stop

If your database has idle periods, you can enable the automatic start/stop feature (disabled by default) to reduce costs. The rules are as follows:

  • Automatic suspend: The instance is automatically suspended after 10 minutes of inactivity.

  • Automatic start: The instance starts automatically when a connection is requested. Startup takes 6 to 40 seconds, depending on the state of its databases and tables, during which the instance is unavailable.

  • 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 those in a testing environment.

  • Intermittent scheduled tasks, such as for educational courses or student labs.

  • Unpredictable workloads, such as in IoT and edge computing.

Limitations

  • Region availability: Serverless instances are only available 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), and Indonesia (Jakarta)

  • Editions: Only Basic Edition and High-availability Edition are supported. Upgrading from Basic Edition to High-availability Edition triggers an instance switchover, causing a brief connection interruption. Ensure that your application has a reconnection mechanism.

  • Storage type: Only PL1 ESSD and Ultra Disk are supported.

  • RCU: You can scale RCUs from 0.5 to 32 in 0.5 RCU increments.

  • Storage capacity: Storage capacity ranges from a minimum of 20 GB (for a PL1 ESSD) or 40 GB (for an Ultra Disk) to a maximum of 64 TB.

  • Storage shrinking: You can only shrink storage capacity manually. The minimum capacity after shrinking is min{data volume * 1.3, data volume + 400 GB}, and it must not be less than the minimum storage capacity for the instance's specification.

  • Instance start/stop: When automatic start/stop is enabled, an instance supports automatic start and suspension, as well as manual start. Manual suspension is not supported.

Billing

A serverless instance is billed hourly. View your billing details on the Expenses and Costs page.

Cost breakdown

  • Total cost formula: Total cost of a serverless instance = Cost per node × Number of nodes

  • Number of nodes: A Basic Edition instance has 1 node, and a High-availability Edition instance has 2 nodes.

  • Cost per node: This includes the cost of computing and storage resources.

    Computing resource cost

    • Billing formula: Hourly computing resource cost = Computing resource unit price × Hourly RCU usage

    • Hourly RCU usage: The average number of RCUs used per second within the hour.

    • Computing resource unit price: The following prices are for reference only. For exact, region-specific pricing, see the ApsaraDB RDS purchase page.

      Click to view unit price details for different regions

      Region

      Unit price

      China (Hangzhou), China (Shanghai), China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Ulanqab), China (Shenzhen), China (Heyuan), China (Guangzhou), China (Chengdu)

      CNY 0.333 per RCU-hour

      US (Silicon Valley), US (Virginia)

      CNY 0.4496 per RCU-hour

      Singapore, Philippines (Manila), Thailand (Bangkok)

      CNY 0.4995 per RCU-hour

      Malaysia (Kuala Lumpur), UK (London)

      CNY 0.5328 per RCU-hour

      Indonesia (Jakarta), Germany (Frankfurt)

      CNY 0.5495 per RCU-hour

      China (Hong Kong), South Korea (Seoul)

      CNY 0.5994 per RCU-hour

      Japan (Tokyo)

      CNY 0.666 per RCU-hour

    Storage resource cost

    • Billing formula: Hourly storage resource cost = Storage resource unit price × Storage capacity

    • Storage capacity: View the storage capacity on the Instance Details page under Basic Information > Instance Resources > Storage Space.

    • Storage resource unit price: The following prices are for reference only. For exact, region-specific pricing, see the ApsaraDB RDS purchase page.

      Click to view unit price details for different regions

      Region

      Unit price

      China (Hangzhou), China (Shanghai), China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Ulanqab), China (Shenzhen), China (Heyuan), China (Guangzhou), China (Chengdu)

      CNY 0.0017 per GB-hour

      Philippines (Manila), Thailand (Bangkok)

      CNY 0.0024 per GB-hour

      China (Hong Kong), South Korea (Seoul), Singapore, Malaysia (Kuala Lumpur), Indonesia (Jakarta), US (Silicon Valley), US (Virginia)

      CNY 0.0026 per GB-hour

      Germany (Frankfurt), UK (London)

      CNY 0.0029 per GB-hour

      Japan (Tokyo)

      CNY 0.003 per GB-hour

Instance state and billing

When automatic start/stop is enabled, the instance state changes as the instance suspends and starts, which in turn affects billing. The following list outlines the state changes and billing impact during a complete start/stop cycle:

  1. The instance starts in the Running state.

  2. If there are no connections for 10 minutes, the instance begins to automatically suspend: its state is Stopping.

  3. The instance is fully suspended: its state is Suspended.

  4. When a database request is received, the instance begins to automatically start: its state is Starting.

  5. The instance returns to the Running state.

Instance state

RCU cost

Storage cost

Stopping

Billed

Billed

Suspended

Not billed

Billed

Starting

Not billed

Billed

Running

Billed

Billed

Billing example

Scenario: You purchase a Basic Edition serverless instance in the China (Hangzhou) region. The computing resource can scale from 0.5 to 8 RCUs, and the storage capacity is 20 GB. Over 24 hours, the instance uses 8 RCUs during a one-hour business peak and 1 RCU for the remaining 23 hours.

Unit price: The unit prices for computing resources and storage resources in the China (Hangzhou) region are as follows:

Billable item

Region

Unit price

RCU

China (Hangzhou)

CNY 0.333 per RCU-hour

Storage

CNY 0.0017 per GB-hour

Cost of computing and storage resources (1 day):

  • RCU cost: (0.333 × 8 × 1) + (0.333 × 1 × 23) = CNY 10.323

  • Storage cost: 0.0017 × 20 × 24 = CNY 0.816

Total cost: CNY 10.323 + CNY 0.816 = CNY 11.139.

Free trial and experience

Free trial

New ApsaraDB RDS users can get a free trial of a Serverless ApsaraDB RDS for MySQL instance. You can choose either a 3-month trial of a Basic Edition instance or a 1-month trial of a High-availability Edition instance. Note the following during the trial:

  • The free trial period cannot be extended, and the instance is not automatically released after the trial expires. It continues to run and incurs fees. If you no longer need the instance, release it manually. You can view the expiration dates, trial progress, and other information for all your trial products on the My Free Trial page.

  • If you have already released the instance, you can ignore text message reminders that the free trial is about to expire.

Online experience

You can experience the automatic elastic capabilities of the serverless feature online and observe the performance and resource usage of a serverless instance in real time, without purchasing any resources.

Create a serverless instance

You can convert an existing pay-as-you-go instance to a serverless instance. Existing subscription instances must first be converted to pay-as-you-go. Alternatively, follow the steps below to create a new serverless instance.

  1. Go to the RDS buy page and set Billing Method to Serverless.

  2. Configure basic instance information

    1. Select a Region. The region cannot be changed after purchase, so choose carefully.

      • To connect from an ECS instance: Select the same region as the ECS instance to enable low-latency internal network connectivity.

      • To connect from other devices: Select a region that is geographically close to your device to reduce network latency.

    2. Select a Database Engine and version. Select MySQL. Only major versions 8.0 and 5.7 are supported.

  3. Configure instance architecture and storage

    1. Select an Editions:

      • Basic Edition: A cost-effective, single-node deployment suitable for development and testing, or for scenarios that do not require high availability.

      • High-availability Edition: A primary-secondary, dual-node deployment that provides automatic failover, suitable for production environments.

    2. Select a Storage Type. You can select Premium Performance Disk (recommended) or ESSD PL1.

  4. Configure auto scaling

    1. Set the RDS Capacity Units (RCUs) range. The instance automatically scales within this range based on its workload.

    2. Select a Scaling Policy. RCU scaling for a serverless instance takes effect immediately and does not impact your services. However, if the system cannot scale smoothly, you can choose from the following options:

      • Execute Forcefully: Forces RCU scaling to ensure database performance. This may cause an instance switchover. Ensure your client application has a reconnection mechanism.

      • Do Not Execute Forcefully: Temporarily defers RCU scaling to maintain existing connections and requests.

    3. Configure Automatic Stop and Restart. When enabled, the instance automatically stops when idle and restarts on request. While the instance is stopped, you are billed only for storage.

  5. Configure network and availability zone

    1. Select a VPC. If you connect to the instance from an ECS instance, we recommend selecting the same VPC to enable internal network connectivity.

    2. Specify whether to Add to Whitelist. If you enable this option, ECS instances in the same VPC can directly access the RDS instance.

    3. Select the Zone and Network of Primary Node. There are no substantial differences between availability zones in the same region. If you selected the High-availability Edition, you must also configure the secondary availability zone and network based on your chosen Deployment Method (multi-AZ or single-AZ deployment).

  6. Configure Storage capacity. The minimum adjustment increment is 5 GB.

  7. (Optional) More. If you do not have specific requirements, you can keep the default values.

    Parameters

    Parameter

    Description

    Parameter Templates

    Select a high-performance, asynchronous, or default parameter template. The parameters in the selected template are displayed on the right. For more information, see Use parameter templates.

    Time Zone

    Set the instance time zone based on your business requirements.

    Table Name Case Sensitivity

    The default value is Case-insensitive. If your source database uses case-sensitive table names, select Case-sensitive to simplify data migration.

    Release Protection

    When enabled, this feature prevents you from accidentally deleting the instance. For more information, see Enable or disable release protection.

    Instance Name

    Enter a name for the instance.

    Tags

    If you have many instances, use tags to classify and manage them. For more information, see Filter instances by tag.

    Resource Group

    Select a default or custom resource group to simplify instance management.

    Privileged Account

    You can select Now and enter an account name and password to create a privileged account. You can also select Later to create the account after the instance is running.

  8. Confirm configuration and place order

    To create multiple serverless instances with the same configuration, specify the quantity in the upper-right corner of the page. You can purchase up to 20 instances at a time. Review the instance configuration and click Confirm Order.

  9. View the instance

    After the payment is successful, click Return to Console or go to the RDS Instances list. Select the region at the top of the page to find your new instance. Instance creation takes about 10 minutes. The instance is ready when its status changes to Running.

    Note

    There may be a short delay between a successful payment and the instance appearing in the console. If the instance does not appear after a few moments, refresh the console.

RCU usage and storage capacity

Review the changes in RCU usage and storage capacity over the last 30 days to decide whether to adjust your auto scaling configuration.

  1. Go to the RDS instance list, select a region at the top of the page, and click the target instance ID.

  2. In the navigation pane on the left, click Monitoring and Alerts.

  3. On the Standard Monitoring tab, click Old Version in the upper-right corner.

  4. On the Resource Monitoring tab, view the Database Capacity (RCUs) and Disk Space trends.

Auto scaling configuration

RCU scaling range and policy

  1. Go to the RDS Instances list, select a region, and then click the target instance's ID.

  2. In the Configuration Information section, click Adjust Scaling Settings.

  3. In the panel, configure auto scaling:

    1. Set RCU scaling range: When your workload changes, adjust the minimum and maximum RCU values to match it.

    2. Set scaling policy: RCU auto scaling for a serverless instance typically takes effect immediately without impacting your services. However, in rare cases where the system cannot scale smoothly, you can choose one of the following options:

      • Force execution: Forces RCU auto scaling to prioritize database performance. This action may cause a service switchover, so ensure your client application has a reconnection mechanism.

      • Do not force execution: Defers the RCU auto scaling operation to maintain existing connections and requests, which prioritizes connection stability.

  4. Click OK.

Adjust storage capacity

A serverless instance automatically expands its storage capacity when available storage is low. However, to ensure instance stability and data security, it does not automatically shrink its storage capacity. To manually adjust the storage capacity, follow these steps:

  1. Go to the RDS Instances list, select a region, and then click the target instance's ID.

  2. On the Basic Information page, in the Instance Resources section, click Modify next to Storage Capacity.

  3. In the panel, adjust the storage capacity, and click OK. In the confirmation dialog box that appears, click OK.

Note

Shrinking storage capacity takes longer than expanding it because the process requires data replication. During scaling, the instance status is Upgrading/Downgrading. When the operation completes, the status changes to Running.

Manage instance start/stop

Enable or disable automatic start/stop

When you enable the automatic start/stop feature, the instance automatically pauses after 10 minutes of inactivity. It automatically restarts when it receives a database request. While the instance is paused, you are billed only for storage, not for compute resources.

  1. Go to the RDS instance list, select the region at the top of the page, and then click the ID of the target instance.

  2. In the Configuration Information section, click Modify Scaling Settings.

  3. Click Advanced Settings. From the Automatic Stop and Restart drop-down list, select Enable or Close, and then click OK at the bottom of the page.

Note

The instance takes approximately 6 to 40 seconds to start. The exact time varies depending on the state of the databases and tables in the instance. The instance is unavailable during startup.

Manually start an instance

Only the automatic start/stop feature can pause a running serverless instance; you cannot pause it manually. You can, however, manually start a paused instance.

  • On the RDS instance list page:

    Go to the RDS instance list, select a region at the top of the page, find the target instance, and in the Action column, choose More > Start Instance.

  • On the instance details page:

    Go to the RDS Instance List, select a region at the top, and then click the target instance ID. On the Basic Information page of the instance, in the Instance Status section, click Start Instance.

View instance start/stop history

In the RDS console, click Tasks in the navigation pane on the left to view the start and stop history for your instance, including both automatic and manual events.

Upgrade to High-availability Edition

Upgrade a Basic Edition serverless instance to the High-availability Edition for enhanced disaster recovery and advanced features.

  1. Go to the Instances page, select a region from the top navigation bar, and then click the target instance ID.

  2. In the Configuration Information section, click Adjust Scaling Settings.

  3. In the panel that appears, select High-availability Edition for Edition and click OK.

  4. In the confirmation dialog box, review the upgrade details and click OK. The instance status is Upgrading/Downgrading during the upgrade and changes to Running upon completion.

Scheduled RCU configuration

The auto scaling of RCUs typically completes within seconds. However, it can take 3 to 5 minutes in rare cases requiring cross-host scaling. If your application has strict stability requirements during specific periods, you can schedule an increase in RCUs for your serverless instance. For detailed instructions, see Configure scheduled tasks to adjust the number of RCUs for a serverless RDS instance.

FAQ

Join the RDS Serverless DingTalk user group (Group ID: 41925003105) for support, discussions, and feedback.

  • Q1: Why doesn't my RDS Serverless instance stop automatically? How can I check its current connection count?

    • The automatic start/stop feature is disabled by default. You must enable it manually.

      • To view the connection count: In the left-side navigation pane of the instance details page, select Monitoring and Alerts and view the Session metric.

      • To identify active connections: Run the SHOW PROCESSLIST command.

    • If an instance has a public endpoint and its whitelist is open to all IP addresses, it may be targeted by malicious external scans that prevent it from stopping automatically. We recommend releasing the public endpoint or modifying the whitelist.

  • Q2: How long does RCU scaling take? What triggers RCU auto scaling?

    • Duration: RCU scaling is typically instantaneous. In rare cases that require a cross-host migration, it can take 3 to 5 minutes. High-availability Edition instances, which include a secondary node, are less likely to require a cross-host migration.

    • Triggers:

      • A scale-up is triggered when either CPU utilization or memory usage reaches the scale-up threshold.

      • A scale-down is triggered when both CPU utilization and memory usage fall to the scale-down threshold.

    • Thresholds:

      • The default scale-up threshold for CPU utilization is 60%, and the scale-down threshold is 40%. These thresholds may be adjusted to ensure availability.

      • The default scale-up threshold for memory usage is 90%, and the scale-down threshold is 80%. These thresholds may be adjusted to ensure availability.

  • Q3: How do I choose the RCU scaling range?

    You can use one of the following methods:

    • Run a stress test to determine the number of RCUs or CPU cores required for your minimum and maximum workloads.

    • Estimate the range based on the CPU cores needed for your workload. One RCU is approximately equivalent to one vCPU and 2 GB of memory.

  • Q4: Am I charged if I am not using my RDS Serverless instance?

    • Automatic start/stop enabled: The instance automatically stops after 10 minutes of inactivity (no connections). In this state, you are charged only for storage fees, not for computing fees.

    • Automatic start/stop disabled: The instance remains in a running state regardless of usage. You are charged for both storage fees and computing fees. When idle, computing fees are typically based on the minimum RCU setting for your instance.

  • Q5: Is an RDS MySQL Serverless High-availability Edition instance a single-zone or multi-zone deployment?

    High-availability Edition instances support both single-zone and multi-zone deployments.