I enabled storage auto scaling for my Amazon Relational Database Service (Amazon RDS) DB instance, but the free storage space is less than 10%. Or, the instance is in a storage-full state.
Short description
When you change your DB instance's storage, the DB instance goes into the storage-optimization state. Storage-optimization usually takes a few minutes to complete, but can take more than 24 hours. To monitor the process, use the Amazon Elastic Compute Cloud (Amazon EC2) console.
Note: You can't make additional storage modifications for either six hours from the last storage modification or until storage-optimization is complete, whichever is longer.
During storage-optimization, auto scaling can't increase your DB instance's storage, even if there's less than 10% of free storage space.
When you use auto scaling to increase your DB instance's storage, the additional storage increases in one of the following increments, whichever is greater:
- 10 GiB
- 10% of currently allocated space
- Storage growth prediction for seven hours based on the FreeStorageSpace metrics for the past hour
If you want to load 50 GB of data in less than one hour, then a 10% storage increase isn't sufficient. Because the previous auto scaling operation is in the storage-optimization state, you can't make storage modifications to the DB instance until the process completes. As a result, your DB instance might be in a storage-full status for up to several hours.
Resolution
If you can't modify your RDS DB instance storage, then check your instance's status. If your DB instance is in storage-full or available, then check if a storage modification occurred in the last six hours. To confirm whether a storage increase operation was recently performed, check your DB instance's events for the following messages:
"Finished applying modification to allocated storage."
-or-
"Finished applying autoscaling-initiated modification to allocated storage."
If your DB instance is in storage-optimization, then restore your database to a DB instance with more Amazon Elastic Block Store (Amazon EBS) storage.
Note: If your DB instance is in the storage-full state, then you must first stop any data loads to the DB instance. This process can take a few minutes to several hours before the instance isn't in a storage-full state.
When your DB instance isn't in a storage-full state, use one of the following options to modify your DB instance storage size:
- Option 1: Create and promote a read replica of your DB instance.
- Option 2: Take a manual DB snapshot and restore your DB instance to a specified point in time.
- Option 3: Turn off auto scaling because you have low FreeStorageSpace.
Note: Options 1 and 2 result in downtime for your database. However, option 1 results in less downtime than option 2. Read replicas are supported by the MariaDB, Microsoft SQL Server, MySQL, Oracle, and PostgreSQL DB engines.
Create and promote a read replica of your RDS DB instance
Complete the following steps:
- Create a read replica of your DB instance.
- Increase the storage capacity of the read replica. By default, Amazon RDS storage auto scaling is deactivated on the read replica.
- Rename your active DB instance to a different name. This stops incoming traffic.
- Rename the read replica to the name that you used for your active DB instance. This changes the read replica endpoint to be the same as the active DB instance, and 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.
Take a manual DB snapshot and restore your RDS DB instance to a specified point in time
Complete the following steps:
- Rename your active DB instance to stop incoming traffic and prevent a storage-full state. If your DB instance is in storage-full, then you can't proceed with the next step.
- Take a DB snapshot of your DB instance.
Note: The snapshot prevents the restored DB instance from storage-optimization storage modification events.
- To restore your DB instance to a point in time, choose the latest restorable time. For the instance identifier, enter the name that was used by your active DB instance.
Note: To avoid auto scaling increases that result in storage-optimization, don't activate auto scaling.
- (Optional) Modify the restored DB instance to include custom security groups. The default database security group is applied to the new DB instance.
- Increase the storage capacity of the new DB instance.
Note: For the application or client, the database downtime occurs during steps 1-4.
Turn off auto scaling because of low FreeStorageSpace
If you turn off auto scaling, then additional storage isn't automatically allocated and you can manually control storage allocation. For example, auto scaling is going to increase storage by 10%, but you want to add more than 10% before the auto scaling event initiates. For this scenario, turn off auto scaling.
To turn off auto scaling, complete the following steps:
- Open the Amazon RDS console.
- In the navigation pane, choose Databases, and then select your database.
- Choose Modify.
- In Storage, under Additional storage configuration, clear Enable storage autoscaling.
- Choose Continue.
- Choose either Apply immediately or Apply during the next scheduled maintenance window.
- Choose Modify DB Instance.
Note: When the FreeStorageSpace metric is less than 10% for at least five minutes, auto scaling initiates. Auto scaling also initiates when at least six hours have passed from the last storage-modification, or storage-optimization has completed on the instance, whichever is longer.
Related information
Why did I receive a "No space left on device" or "DiskFull" error on Amazon RDS for PostgreSQL?
Why does my Amazon RDS for Oracle DB instance use more storage than I expect?
Why is my Amazon RDS for MySQL DB instance using more storage than expected?
How do I optimize storage consumption in my Amazon RDS for SQL Server DB instance?