Why does my Amazon RDS DB instance have low free storage space or why is my DB instance in a storage-full state after I enabled storage autoscaling?
Last updated: 2020-03-05
I enabled storage autoscaling for my Amazon Relational Database Service (Amazon RDS) DB instance, but I see that the free storage space is below 10% or the instance is in a storage-full state. Why is this happening, and how can I fix this?
If you recently increased the RDS DB instance's storage, either manually or by autoscaling, then the instance can't have any more storage modifications for six hours (the cooldown period) after the DB instance completes the storage optimization. The storage modification cooldown period can exceed six hours total because the cooldown period begins only after the operation is finished, and the storage optimization can sometimes take hours to complete. During the storage modification cooldown period, autoscaling can't increase your DB instance's storage, even if there is less than 10% of free storage space. For more information, see Increasing DB Instance Storage Capacity.
If you increased the RDS DB instance's storage using autoscaling, the storage is increased by 5 GiB, 10% of currently allocated storage, or predicted growth based on the FreeStorageSpace metrics in the past hour, whichever is greatest.
If you expect an increase in your data load (such as a load that is larger than 20% of your RDS DB instance's current storage size), it's a best practice to manually increase the size of your RDS DB storage before the data load. For example, if your RDS DB instance's storage size is 100 GiB and has 10.1 GiB of free space, and the storage consumption is usually 100 MB per hour, then autoscaling will increase the storage by 10% (10 GiB). But if you expect to load 50 GiB of data in less than one hour, the 10% storage increase won't be sufficient. And because the previous autoscaling operation is in the storage modification cooldown period, the RDS DB instance can't have any storage modifications for at least six hours, resulting in an RDS DB instance that is in a storage-full status for several hours.
If you can't increase the storage size of your RDS DB instance, first check for the following indications that your instance is affected by the storage modification cooldown period:
- The status of your RDS DB instance is Storage-optimization.
- The status of your RDS DB instance is Storage-full or Available, but there was a recent storage modification. To confirm that a storage increase operation was recently performed, check your RDS DB instance's events for the following messages: "Finished applying modification to allocated storage" or "Finished applying autoscale initiated modification to allocated storage." Because the cooldown period begins after the storage optimization is complete and the operation can take several hours to finish, it's best to check for storage modifications over the previous 24 hours.
If there was a recent storage modification and you can't wait for the cooldown period to pass, then you can restore your database into a new RDS DB instance that has more Amazon Elastic Block Store (Amazon EBS) storage. However, if the RDS DB instance is in Storage-full state, you must first stop any data loads on the RDS DB instance. Then you can release storage space from your RDS DB instance by following the process for your database engine. After you stop all data loads on the RDS DB instance, Amazon RDS automation also tries to release space that's used by log files. But this process can take from a few minutes to several hours before the instance is no longer in a Storage-full state.
If the RDS DB instance isn't in a Storage-full state, you can use either of the following methods to increase your DB instance storage size.
- Option 1: Create and promote a read replica of your RDS DB instance
- Option 2: Take a manual DB snapshot and restore your RDS DB instance to a point in time
Both of these options result in downtime for your database, but creating and promoting a read replica results in less downtime. Amazon RDS read replicas are supported on all versions for MySQL, MariaDB, and PostgreSQL engines. For Oracle database instances, read replicas are supported only by Oracle Enterprise Edition, version 126.96.36.199.v10 and higher. To use Oracle read replicas, you must have an Active Data Guard license.
Option 1: Create and promote a read replica of your RDS DB instance
- Create a read replica of your RDS DB instance, if you don't already have one.
- Manually increase the storage capacity of the read replica. By default, Amazon RDS storage autoscaling is disabled on the read replica.
- Rename your active RDS DB instance to a different name to stop all incoming traffic.
- Rename the read replica to the name that was previously used by your active RDS DB instance. This changes the read replica endpoint to be the same as the active RDS DB instance, so you don't have to reconfigure your applications.
- Promote your read replica.
Note: For the application or client, the database downtime occurs during steps 3–5.
Option 2: Take a manual DB snapshot and restore your RDS DB instance to a point in time
- Rename your active RDS DB instance to stop all incoming traffic. This prevents the RDS DB instance from reaching a Storage-full state. If the RDS DB instance is in a Storage-full state, you can't proceed with the next step to take the manual snapshot.
- Take a DB snapshot of your RDS DB instance. You must take a new snapshot to prevent the restored RDS DB instance from also being affected by a storage modification cooldown period.
- Restore your RDS DB instance to a point in time by choosing the latest restorable time. Then for the instance identifier, enter the name that was used by your active RDS DB instance. Note: To avoid any further autoscaling increases that result in a cooldown period, don't enable autoscaling for now.
- Optionally, modify the restored RDS DB instance to include any custom security groups. The default database security group is applied to the new RDS DB instance. If you use any custom security groups, set them now.
- Manually increase the storage capacity of the new RDS DB instance.
Note: For the application or client, the database downtime occurs during steps 1–4.