Skip to content

How to successfully reduce RDS storage size using Blue/Green deployment?

0

I’m trying to reduce allocated storage for an RDS MySQL instance using the Blue/Green deployment approach, following this AWS blog:

Shrink storage volumes for your RDS databases and optimize your infrastructure costs

Source DB details

  • Engine: MySQL 8.0.42
  • Current allocated storage: 330 GB
  • FreeStorageSpace from CloudWatch: ~270 GB
  • Storage autoscaling: Disabled
  • File system configuration: Upgrade available

According to the blog, the new allocated size must be at least 20% greater than FreeStorageSpace. So in my case:

330 GB (allocated) - 270 GB (free) = 60 GB used
60 GB * 1.2 = 72 GB minimum

I set the Blue/Green target storage to 80 GB, which should be above the required threshold.

However, the deployment fails with the following logs:

September 04, 2025, 10:24 (UTC+02:00) 
Your blue/green deployment bgd-hqavqgeih97lny10 will create a read replica of dltdb with storage type gp3, and allocated storage 80.

September 04, 2025, 11:43 (UTC+02:00) 
Failed to reduce storage for blue/green deployment bgd-hqavqgeih97lny10. 
See the documentation for valid target-allocated-storage values.

My questions:

  • Why would 80 GB not be considered a “valid target-allocated-storage value” when it satisfies the +20% storage allocation rule from the blog?
  • Are there additional hidden constraints (minimum absolute size, step granularity, engine-specific requirements, etc.) that I might be missing?
  • Has anyone successfully reduced RDS storage with this method for MySQL, and what target values worked for you?
  • Are there any logs I can check that would provide more descriptive details about why the storage reduction failed?

Any insights or examples would be greatly appreciated.

asked a year ago1.2K views

2 Answers
0
Accepted Answer

I managed to solve this.

I was able to reduce the size of the storage by allocating 100 GB, which is about +65% of the used space according to CloudWatch. That deployment completed successfully.

I’m still not sure if it would have worked with a value somewhere between the previously tested 80 GB (already +35% of used space) and the working 100 GB.

At one point I suspected the extra space requirement might be related to the file system configuration upgrade step mentioned in the docs/blog. To test this, I tried creating a read replica with the current filesystem, promoted it, and then attempted to reduce the storage to 80 GB. That failed with the same “valid target-allocated-storage values” error.

So in practice, the lower bound seems to be stricter than the blog’s +20% rule, at least for my instance.

Takeaway: If you run into this issue, don’t just aim for the minimum +20%. In my case, I needed closer to +65% of used space before the Blue/Green deployment succeeded. It may be worth experimenting with higher values if the lower bound fails.

answered a year ago

EXPERT

reviewed a year ago

0

To successfully reduce RDS storage size using Blue/Green deployment, you need to follow specific guidelines and understand certain limitations:

Steps for RDS Storage Reduction via Blue/Green Deployment

  1. Create a Blue/Green Deployment through the Amazon RDS console:
  • Navigate to the storage section
  • Set the allocated storage for the green database to your desired smaller size
  • For example, if your blue database is 400GB, you could create a green database with 200GB
  1. Wait for Deployment Completion:
  • The creation process may take hours or days depending on database size, storage type, and IOPS
  • Monitor the progress until the green environment shows as available
  1. Perform the Switchover:
  • Once the green environment is fully deployed and available, orchestrate a managed switchover
  • The promotion process is quick and can be completed in as little as a minute with no data loss
  1. Clean Up:
  • After successful switchover, delete the blue/green deployment
  • Delete the old blue instance to save on costs

Regarding Your Specific Issue

Your calculation approach is correct in principle, but there might be several reasons for the failure:

  1. Engine Support: Ensure your MySQL version is fully supported. Blue/Green Deployments with storage shrinking is available for MySQL major versions 5.7 and higher.

  2. Hidden Constraints: There might be additional factors beyond the 20% rule:

  • The system might be calculating used space differently than your CloudWatch metrics suggest
  • There could be temporary storage usage not reflected in the FreeStorageSpace metric
  • MySQL might have specific storage requirements based on your database configuration
  1. Storage Optimization: Before attempting the Blue/Green deployment:
  • Consider running OPTIMIZE TABLE operations on large tables
  • This can help reduce fragmentation and ensure more accurate space calculations
  1. Alternative Approach: If Blue/Green deployment continues to fail, you could consider:
  • Creating a new RDS instance with lower allocated storage
  • Using AWS DMS Serverless to migrate data from your current database
  • This approach has been successfully used for significant storage reductions

Remember that the Blue/Green deployment method for storage reduction is relatively new (announced in November 2024), so you might be encountering edge cases in the implementation.
Sources
Amazon RDS Blue/Green Deployments support storage volume shrink - AWS
Shrink storage volumes for your RDS databases and optimize your infrastructure costs | AWS Database Blog
Scaling Amazon RDS for MySQL performance for Careem’s digital platform on AWS | AWS Database Blog
Managing capacity automatically with Amazon RDS storage autoscaling - Amazon Relational Database Service

answered a year ago

EXPERT

reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.