Updated on 2026-04-24 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

  • Changing the instance class will temporarily occupy IP addresses, and the IP addresses will not be released until 12 hours later by default. Before changing an instance class, ensure that there are available floating IP addresses (two for a primary/standby instance and one for a single instance or read replica) in the subnet. Otherwise, the change will fail.
  • 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 database proxy is abnormal or being changed.
    • The instance has a scheduled instance class change task.

During the change

  • If there are any large transactions being processed during an instance class change, the change may fail.
  • Any session that holds a global read lock can cause a change failure.
  • An instance cannot be deleted while its instance class is being changed.
  • The following operations cannot be performed on an instance whose instance class is being changed: rebooting the instance, scaling up storage space, modifying the parameter template, creating a manual backup, creating a database account, and creating a database.
  • If you change the instance class of a read replica, binlog cleanup will be disabled for the primary DB instance. Pay attention to the storage space usage.

After the change

  • After the 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. Change instance classes during off-peak hours because the change takes much more time during peak hours.
  • Changing an instance class takes 5 to 16 minutes for an instance using cloud disks (non-peak hours).
  • If you choose to change an instance class during the maintenance window, after the request is submitted, you can locate the scheduled task and click Execute Now in the Operation column. The time required for changing an instance class can be a little bit long during peak hours due to high replication delay.

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click in the upper left corner of the page and choose Database > Relational Database Service.
  4. On the Instances page, locate the target DB instance and choose More > Change Instance Class in the Operation column.

    Alternatively, click the instance name to go to the Basic Information page. Find Instance Class and click Configure.

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

    Choose a new instance class and a scheduled time, and click Next.

    • Immediate: An instance class change is applied immediately after the request is submitted.
    • During maintenance window: If you select this option, set the maintenance window to off-peak hours.

      If you select During maintenance window, you can further click Modify under the option to change the maintenance window to a preferred time.

  6. Confirm the specifications.

    • If you need to modify your settings, click Previous.
    • Click Submit.

  7. 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, click the DB instance and view its instance class on the displayed Basic Information page to check that the change is successful.