Updated on 2025-11-11 GMT+08:00

Changing a DB Instance Class

Scenarios

You can change the instance class (vCPUs and memory) of a DB instance as required.

Constraints

Table 1 Constraints

Phase

Constraints

Before the change

  • An instance class can fail to be changed when:
    • The instance status is Abnormal, Creation failed, Storage full, or Creating.
    • The replication delay between the primary instance and standby instance is greater than 300 seconds, or the replication relationship is abnormal.
    • The standby instance is being rebuilt.
  • The maximum throughput of extreme SSDs depends on instance specifications:
    • For specifications with more than 32 vCPUs, the maximum throughput is 1,000 MiB/s.
    • For specifications with 32 vCPUs or fewer, the maximum throughput may not reach 1,000 MiB/s due to the underlying architecture.

During the change

After the change

  • After the instance class of an instance using cloud disks is changed, binlogs are not reset.
  • After an instance class is changed, some parameters are automatically changed to the default values defined in the new instance class. The parameters are threadpool_size, innodb_buffer_pool_size, innodb_io_capacity, innodb_io_capacity_max, innodb_buffer_pool_instances, back_log, and max_connections.

Change Duration and Impact on Workloads

  • Changing an instance class will interrupt services for about 10 to 120 seconds. Ensure that your applications support automatic reconnection. Perform this operation during off-peak hours because changing an instance class during peak hours takes much more time.
  • Changing an instance class takes 5 to 15 minutes.
  1. Log in to the management console.
  2. Click in the upper left corner of the page and choose Databases > Relational Database Service.
  3. On the Instances page, locate the target DB instance and choose More > Change Instance Class in the Operation column.

    Alternatively, click the target instance name to go to the Overview page. Under Instance Class, click Configure.

  4. On the displayed page, specify a new instance class and click Next.

    • Upon submission: An instance class change is applied immediately after the request is submitted.
    • Maintenance Window: If you select this option, you are advised to set the maintenance window to off-peak hours.

  5. Confirm the specifications.

    • If you need to modify your settings, click Previous.
    • For pay-per-use DB instances, click Submit.
    • For yearly/monthly DB instances:
      • If you intend to scale down the DB instance class, click Submit.

        The refund is automatically returned to your account. You can click Billing in the upper right corner and then choose Orders > My Orders in the navigation pane on the left to view the details.

      • If you intend to scale up the instance class, click Pay Now. The scale-up starts only after the payment is successful.

  6. Check the change result.

    Return to the Instances page and view the instance status. During the change period, the instance status is Changing instance class. After a few minutes, view the DB instance class on the Overview page to check that the change is successful.

    After the instance class is changed, the values of the following parameters will be changed accordingly: back_log, innodb_buffer_pool_size, innodb_log_buffer_size, innodb_log_files_in_group, max_connections, innodb_page_cleaners, innodb_buffer_pool_instances, threadpool_size, and slave_parallel_workers.

  1. Log in to the management console.
  2. Click in the upper left corner of the page and choose Databases > Relational Database Service.
  3. On the Instances page, locate the target read replica and choose More > Change Instance Class in the Operation column.

    Alternatively, click the read replica name to go to the Overview page. Under Instance Class, click Configure.

  4. On the displayed page, specify a new instance class and click Next.

    • Upon submission: An instance class change is applied immediately after the request is submitted.
    • Maintenance Window: If you select this option, you are advised to set the maintenance window to off-peak hours.

  5. Confirm the settings.

    • If you need to modify your settings, click Previous.
    • For pay-per-use read replicas, click Submit.
    • For yearly/monthly read replicas:
      • If you intend to scale down the instance class, click Submit.

        The refund is automatically returned to your account. You can click Billing in the upper right corner and then choose Orders > My Orders in the navigation pane on the left to view the details.

      • If you intend to scale up the instance class, click Pay Now. The scale-up starts only after the payment is successful.

  6. Check the change result.

    Return to the Instances page and view the read replica status. During the change period, its status is Changing instance class. After a few minutes, view the instance class of the read replica on the Overview page to check that the change is successful.

    After the instance class is changed, the values of the following parameters will be changed accordingly: back_log, innodb_buffer_pool_size, innodb_log_buffer_size, innodb_log_files_in_group, max_connections, innodb_page_cleaners, innodb_buffer_pool_instances, threadpool_size, and slave_parallel_workers.

Can I Change the Instance Class of a Primary DB Instance and Its Read Replicas at the Same Time?

No.

To prevent long delay and high load of a read replica, its instance class should be greater than or equal to that of its primary DB instance.

Follow-up Operations

Return to the instance list. In the navigation pane on the left, choose Task Center and check the progress of the change task.
  • If you have selected Upon submission for Scheduled Time:

    On the Instant Tasks page, search for "Changing a MySQL DB instance class" and check the execution progress. Instant tasks cannot be canceled.

  • If you have selected Maintenance Window for Scheduled Time:

    On the Scheduled Tasks page, search for the instance ID and check the execution status of the change task.

    If the task is in the To be executed state, you can click Cancel to cancel the task.

For details, see Viewing a Task.