FAQ about storage capacity
This topic answers common questions about the storage capacity of RDS instances.
You can join the RDS Storage Capability Communication DingTalk group (ID: 121770005512) to obtain more information about RDS storage capabilities. You can ask questions, communicate, and provide feedback in the group.
Storage scale-up: process and impacts
You can scale up the storage capacity directly. If the current host has insufficient storage, the system automatically provisions a new primary/secondary instance pair on a host with sufficient storage and synchronizes data from the original instance.
For more information about how to scale up storage capacity and whether the process causes a transient connection interruption, see the following topics:
How is storage scaling billed?
Billing changes after you scale up the storage capacity of an RDS instance. For more information, see Billing rules for configuration changes.
Troubleshooting sudden storage increases
Go to the Instances page. In the top navigation bar, select a region, and then click the ID of the target RDS instance.
In the left-side navigation pane, click Monitoring and Alerts. On the page that appears, view the disk space line chart. This chart displays the total disk space usage and breaks it down into data space usage, log space usage, temporary file space usage, and system file space usage. Use this information to identify which category is causing the sudden increase.
How to free up space
Why empty databases consume space
Initializing a database creates system tables to store information such as accounts, permissions, and other metadata. In addition, database system logs, such as redo and undo logs, also occupy disk space.
Space usage of data imported to MySQL
Different database storage engines handle data differently. Factors such as compression support and whether fields are indexed can affect the storage space used.
Does storage capacity include backup storage?
No. The value of Storage Capacity in the Usage Statistics section on the Basic Information page of an RDS instance in the console indicates only the instance's storage capacity and does not include backup storage. To view your backup storage usage, see Backup size.
Handling instance locks due to full storage
When the storage of an RDS instance is exhausted, the instance is automatically locked. The status change may be delayed due to system inspection latency.
Once an RDS instance is locked, you cannot write data to it. We recommend that you configure alerts to prevent your instance from being locked due to full storage. You can also enable automatic storage expansion. When storage is insufficient, the instance automatically expands its storage capacity. For more information, see the following topics:
For an ApsaraDB RDS for MySQL instance, see Configure automatic storage expansion.
For ApsaraDB RDS for MySQL instances, you can also enable automatic fragment reclamation to clean up fragments and reclaim storage space.
For an ApsaraDB RDS for PostgreSQL instance, see Configure automatic storage expansion.
For an ApsaraDB RDS for SQL Server instance, see Configure automatic storage expansion.
Solution:
If your instance becomes locked, see What to do if the storage of an instance is full for solutions.
Why SQL Server does not reclaim space
When you run a DELETE operation to delete a large amount of data from an ApsaraDB RDS for SQL Server instance, disk space is not immediately reclaimed. This behavior is due to the design and logging mechanisms of the database management system:
Transaction log recording: To ensure data consistency and recoverability, SQL Server records every data operation, including
DELETE, in the transaction log. This means that even after data is marked for deletion, the corresponding log entries still occupy disk space, which can cause disk usage to increase rather than decrease.Unreleased data pages: In SQL Server, data is stored on data pages. When data is deleted, the system marks these pages as reusable instead of immediately reclaiming them. This design improves the efficiency of subsequent inserts by avoiding frequent physical disk reorganizations. Therefore, although the data is logically deleted, the physical space is not immediately returned to the operating system.
Table and index fragmentation: Deleting data can leave empty gaps in tables and indexes, causing storage space to become fragmented. However, the database still considers this fragmented space as allocated.
To reclaim this space, we recommend that you take the following actions:
Shrink the database or file groups: Use the
DBCC SHRINKDATABASEorDBCC SHRINKFILEcommand to reclaim unused space and reduce the size of data files.ImportantThis process can be time-consuming, and frequent shrinking may negatively affect performance. For more information, see Resolve the automatic locking of an ApsaraDB RDS for SQL Server instance caused by full storage or Insufficient storage space on an ApsaraDB RDS for SQL Server instance.
Rebuild indexes: After you delete a large amount of data, indexes may become fragmented. Rebuilding an index helps reorganize data pages, reclaim space, and improve query performance.
Back up the transaction log: For databases that use the full recovery model, backing up the transaction log regularly truncates the log and frees up log space. For more information, see Manage logs and Introduction to the simple recovery model.
Consider using TRUNCATE TABLE: In appropriate scenarios, the
TRUNCATE TABLEcommand is more efficient thanDELETE. It directly releases data pages without generating a large number of log records, making it faster.ImportantThe
TRUNCATEoperation is irreversible and does not support aWHEREclause.
In summary, to effectively reduce disk space usage, you may need to combine these actions to optimize your database storage.
Does backup quota increase with storage scale-up?
Yes, the free backup quota for an RDS instance depends on its storage capacity. When you scale up the instance's storage capacity, its free backup quota also increases. For an instance that uses cloud disks, the free backup quota is 200% of its storage capacity. For an instance that uses Premium Local SSDs, the free backup quota is 50% of its storage capacity. The free quota is measured in gigabytes (GB) and is always rounded up to the nearest integer.