Reduce the storage capacity of an ApsaraDB RDS for MySQL instance that uses cloud disks to cut costs and reclaim over-provisioned resources. During the same operation, you can also downgrade the performance level (PL) of an enterprise SSD (ESSD) and change the instance type.
A storage scale-in triggers data migration followed by a switchover. The switchover causes a transient connection lasting about 15 seconds, during which most database, account, and network operations are unavailable. Perform scale-ins during off-peak hours and make sure your application has automatic reconnection configured.
Prerequisites
Before you begin, make sure that:
Your instance meets all of the following requirements. Check the Basic Information page for details.
Major engine version: 5.7 or 8.0
Minor engine version: 20210430 or later
Storage type : ESSD or premium performance disk. Standard SSDs are not supported.
NoteStandard SSDs are discontinued. If your instance uses a standard SSD, upgrade it to an ESSD before proceeding.
Instance architecture : new architecture (kindcode=18) only.
NoteQuery the architecture using the DescribeDBInstanceAttribute API. If your instance uses the old architecture (kindcode=1 or 3), upgrade the minor engine version first.
The instance is in the Running state.
The log backup feature is enabled.
Your Alibaba Cloud account has no unpaid renewal orders. To check, hover over Expense in the upper-right corner of the console and click Orders. On the Orders for Services page, pay for or cancel any outstanding orders.
If you are scaling in a read-only instance, its primary instance is in the Running state.
Limitations
Scale-in frequency: Up to twice per day. Avoid frequent scale-ins to prevent service disruptions.
Eligible configurations: Scale-in is supported only within the same instance series and architecture.
Minimum storage after scale-in: The new capacity must satisfy both of the following conditions:
At least
min(current usage × 1.3, current usage + 400 GB)At least the minimum storage capacity allowed for the current disk type: Storage capacity can be adjusted in 5 GB increments.
Disk type Minimum capacity ESSD PL1 20 GB ESSD PL2 500 GB ESSD PL3 1,500 GB Premium performance disk 10 GB
Scale-in examples (ESSD PL1 instance, original capacity: 2,000 GB):
| Storage used | Formula result | Minimum you can scale down to |
|---|---|---|
| 10 GB | 13 GB | 20 GB (PL1 minimum applies) |
| 500 GB | 650 GB | 650 GB |
| 1,500 GB | 1,900 GB | 1,900 GB |
Primary and read-only instances: The storage capacity of a read-only instance must be greater than or equal to that of its primary instance. Scale in the primary instance before scaling in any read-only instances.
Binary log rate: If your instance generates binary logs at a high rate, make sure enough logs are retained locally before starting the scale-in. See Modify RDS backup policy for how to configure log backup.
Backup jobs: A scale-in may cancel a running backup job. Start the scale-in after any in-progress backup completes.
High-traffic instances: Scale-in duration depends on disk usage and service traffic. For high-traffic instances, increase the local log retention period and the number of retained log files to improve scale-in efficiency and success rate.
Procedure
Scale in a pay-as-you-go or subscription instance
Go to the RDS instance list, select a region, and click the target instance ID.
In the Configuration Information section, click Change Specifications.
(Subscription instances only) In the dialog box, click Downgrade, then click Next.
Configure the scale-in parameters:
Parameter Description Storage Type (Optional) Select a different storage type. Instance Type (Optional) Select a different instance type. Storage Capacity Move the slider or click the minus icon to set the target capacity. The value must satisfy the minimum storage formula and cannot be less than the minimum allowed for your disk type. Capacity adjusts in 5 GB increments. Switching Time Select when the switchover occurs after data migration completes: Switch Immediately After Data Migration performs the switchover as soon as migration finishes. Switch Within Maintenance Window delays the switchover until the configured maintenance window. Both options cause a transient connection during the switchover. Read and accept the Terms of Service. Click Confirm Order, review the before-and-after configuration summary, click Continue, and complete the payment.
The instance status changes to Upgrading during the scale-in. After the operation completes, the status returns to Running. A storage scale-in requires data copying and takes longer than a scale-out.
Scale in a Serverless instance
Go to the RDS instance list, select a region, and click the target instance ID.
On the Basic Information page, find the Instance Resources section and click Modify next to Storage Capacity.
In the panel, click the minus icon to set the target capacity, click OK, and then click Confirm in the dialog box.
The instance status changes to Upgrading during the scale-in. After the operation completes, the status returns to Running.
FAQ
How long does the transient connection last during a scale-in?
About 15 seconds. During that time, most database, account, and network operations are unavailable. Perform the scale-in during off-peak hours and configure automatic reconnection in your application.
Can I scale in an instance that uses a standard SSD?
No. Standard SSDs do not support scale-in, and .. Upgrade to an ESSD first, then follow the steps in this topic.
What's next
Use the ModifyDBInstanceSpec API to scale in programmatically: set
DBInstanceStorageto the target capacity and configure other parameters as needed.For instances that use high-performance local disks, see Change configuration.