This topic describes how to manually reduce the storage capacity of an ApsaraDB RDS for MySQL instance that uses cloud disks. When the storage capacity of your RDS instance that uses cloud disks exceeds your actual needs, you can reduce the storage capacity to avoid resource waste and lower costs. When you reduce the storage capacity of an RDS instance that uses Enterprise SSDs (ESSDs), you can lower the performance level (PL) of the ESSDs and downgrade the instance type of the RDS instance.
Prerequisites
Your RDS instance meets the following requirements:
The RDS instance runs MySQL 5.7 or MySQL 8.0.
The RDS instance runs a minor engine version of 20210430 or later.
The RDS instance runs RDS Basic Edition, RDS High-availability Edition, or RDS Cluster Edition. If the RDS instance runs RDS Cluster Edition, the instance must reside in the Singapore region.
The RDS instance uses the ESSD storage type.
The log backup feature is enabled for the RDS instance. For more information, see Use the log backup feature.
NoteYou can go to the Basic Information page of the RDS instance to view the preceding information.
You cannot reduce the storage capacity of a serverless RDS instance that uses cloud disks.
For more information about how to reduce the storage capacity of an RDS instance that uses local disks, see Change instance specifications.
Your Alibaba Cloud account does not have unpaid renewal orders.
NoteIf your Alibaba Cloud account has an unpaid renewal order, you must complete the payment or cancel the order. To complete the payment or cancel the order, perform the following operations: Log on to the ApsaraDB RDS console. In the top navigation bar, choose Expenses > Orders. On the Orders page, complete the payment or cancel the order.
The RDS instance is in the Running state.
When you reduce the storage capacity of a read-only RDS instance that uses cloud disks, the primary RDS instance of the read-only RDS instance is in the Running state.
Limits
You can manually reduce the storage capacity of an RDS instance that uses cloud disks up to twice a day. This prevents your services from being negatively affected.
If your RDS instance runs RDS Basic Edition, RDS High-availability Edition, or RDS Cluster Edition and uses cloud disks, you can reduce the storage capacity without the need to change the RDS edition or architecture of the RDS instance. The minimum storage capacity after the storage capacity reduction must be greater than or equal to the minimum storage capacity that is supported by the instance type of the RDS instance. You can use the following formula to calculate the minimum storage capacity to which you can reduce your RDS instance:
min{Used storage × 1.3, Used storage + 400 GB}
. You can reduce the storage capacity at a step size of 5 GB.NoteThe following list describes the minimum storage capacity that is allowed for each PL ESSD:
PL1 ESSD: 20 GB
PL2 ESSD: 500 GB
PL3 ESSD: 1,500 GB
The following information provides examples:
Your RDS instance provides 2,000 GB of storage capacity and uses the PL1 ESSD storage type. The following list describes the minimum storage capacity to which you can reduce your RDS instance varies based on the storage usage:
If 10 GB of storage is used, the value obtained by using the preceding formula is 13 GB. In this case, the minimum storage capacity to which you can reduce your RDS instance is 20 GB.
If 500 GB of storage is used, the value obtained by using the preceding formula is 650 GB. In this case, the minimum storage capacity to which you can reduce your RDS instance is 650 GB.
If 1,500 GB of storage is used, the value obtained by using the preceding formula is 1,900 GB. In this case, the minimum storage capacity to which you can reduce your RDS instance is 1,900 GB.
The storage capacity of a read-only RDS instance must be greater than or equal to the storage capacity of its primary RDS instance. We recommend that you reduce the storage capacity of the primary RDS instance and then the storage capacity of its read-only RDS instances.
The duration of the storage capacity reduction process for an RDS instance that uses cloud disks varies based on disk usage and business traffic. If your business traffic is high, we recommend that you change the retention policy of binary log files for the RDS instance, and increase the retention period and the number of binary log files to improve the efficiency and success rate of the storage capacity reduction.
If the binary log files of your RDS instance are generated in a quick manner, you can reduce the storage capacity of the RDS instance only after a specific number of binary log files are retained.
Impacts
When you reduce the storage capacity of your RDS instance that uses cloud disks, a 30-second transient connection occurs. During the transient connection, you cannot perform most of the operations that are related to databases, accounts, and network settings. We recommend that you reduce the storage capacity of your RDS instance that uses cloud disks during off-peak hours. Make sure that your application is configured to automatically reconnect to your RDS instance.
Billing rules
For more information about billing rules, see Specification changes.
Procedure
Log on to the ApsaraDB RDS console and go to the Instances page. In the top navigation bar, select the region in which your RDS instance resides. Then, find the RDS instance and click the ID of the RDS instance.
In the Configuration Information section of the page that appears, click Change Specifications.
In the dialog box that appears, click Downgrade and click Next. This step is required only when the RDS instance uses the subscription billing method.
Configure the following parameters.
Parameter
Description
Storage Type
Optional. Configure this parameter based on your business requirements.
Instance Type
Optional. Configure this parameter based on your business requirements.
Storage Capacity
Drag the slider or click the minus icon to specify the new storage capacity for your RDS instance.
NoteThe minimum storage capacity to which you can reduce your RDS instance is calculated by using the following formula:
min{Used storage × 1.3, Used storage + 400 GB}
. The minimum storage capacity after the storage capacity reduction must be greater than or equal to the minimum storage capacity that is supported by the instance type of the RDS instance. You can reduce the storage capacity at a step size of 5 GB.Switching Time
Select Execute Immediately or Switch Within Maintenance Window.
NoteExecute Immediately: The data is immediately migrated, which does not affect workloads on the RDS instance during the migration. After the data is migrated, the system immediately switches over your workloads. A transient connection occurs during the switchover.
Switch Within Maintenance Window: Your data is immediately migrated, which does not affect workloads on the RDS instance. After the data is migrated, the system switches your workloads within the maintenance window. A transient connection occurs during the switchover. For more information, see Configure a maintenance window.
Read and select Terms of Service and click Pay Now. In the dialog box that appears, confirm the instance information before and after the specification change and click Continue to complete the payment.
FAQ
When I reduce the storage capacity of my RDS instance that uses cloud disks, how long does a transient connection last?
The transient connection lasts for approximately 30 seconds. During the transient connection, you cannot perform most of the operations that are related to databases, accounts, and network settings. We recommend that you reduce the storage capacity of your RDS instance that uses cloud disks during off-peak hours. Make sure that your application is configured to automatically reconnect to your RDS instance.
How do I reduce the storage capacity of my RDS instance that uses standard SSDs?
Standard SSDs are no longer available for purchase. If you want to reduce the storage capacity of your RDS instance that uses standard SSDs, you can upgrade the storage type from standard SSD to ESSD and then reduce the storage capacity. For more information, see [EOS/Discontinuation] End of sale for the standard SSD storage type for specific database engines in ApsaraDB RDS from July 01, 2022.
Related operations
Operation | Description |
Reduces the storage capacity of an instance. When you call the ModifyDBInstanceSpec operation to reduce the storage capacity of an instance that uses cloud disks, you must change the value of the DBInstanceStorage parameter to the new storage capacity. You can configure other parameters based on your business requirements. |
References
For more information about how to change other specifications of an RDS instance, see Change instance specifications.