Skip to content

RDS blue/green deployment is not decreasing the storage

1

My rds instance is db.m5.2xlarge with 1000GB gp3 storage with max storage of 1300GB with actual storage in use is 100GB.

To reduce the cost, First I directly changed the instance type to db.m6g.2xlarge from db.m5.2xlarge. Next I choose blue/green deployment to reduce the storage and select 200GB.

But when blue/green deployment is complted, I see green instance is with 1300GB storage.

Please guide, why this strange thing occured. I had earlier blue green deployemnt to change storage from 100GB gp2 to 20GB gb gp3.

asked 2 years ago1.2K views

3 Answers
1

RDS blue/green deployments has a bug, which I'm about to report in a separate post. As a workaround, I disabled storage autoscaling before blue/green deployment and re-enabled autoscaling after the switchover. Only then was I able to reduce the storage size of my database.

As a side note, if you create a brand new database, and then use blue/green deployments to scale the storage down, that works! I imagine that's the test case that Amazon used, but it is a poor test case. They need to use real-world databases as test cases, and then they'd see that scaling down storage during blue/green deployments really doesn't work unless autoscaling is disabled.

answered a year ago

-1

RDS B/G deployments support volume downsizing, see here:

https://aws.amazon.com/about-aws/whats-new/2024/11/amazon-rds-blue-green-deployments-storage-volume-shrink/

Possibly you did not use the target-allocated-storage option in the create-blue-green-deployment command, or something else was configured incorrectly. You can reach out to AWS Support for further trouble-shooting on why you encountered this issue.

AWS

answered a year ago

  • So here is what is happening with me (Postgres 17):

    • The "Storage file system configuration upgrade" is mandatorily turned on whenever I reduce the disk space of the green instance during the config
    • The new database spins up either with more space or with lesser storage but then decides autoscales. There is no way to prevent the autoscale.
    • I have tried it 3 times and always my final DB is larger than the initial DB I started even though only 10% storage is used.

    I have a DB with about 9GB of data. My current (blue) is set to 100 and I am reducing the green instance size to 20GB. My final instance has 150 GB storage. All through, the freespace graph shows only 9GB is used and the rest (initially 11 GB and then upto 141GB) is free.

    I have tried 3 times with the same result.

-4

The behavior you're experiencing with the RDS blue/green deployment not decreasing the storage as expected is likely due to a limitation in how Amazon RDS handles storage modifications.

When you create a blue/green deployment, the green environment is typically created as a copy of the blue (current) environment. In your case, even though you selected 200GB for the new storage size, the green instance maintained the maximum storage setting of 1300GB from your original instance.

RDS generally doesn't allow reducing allocated storage once it has been set to a higher value. This is true even when using blue/green deployments. The system is designed to prevent potential data loss that could occur if the storage size were reduced below the current data volume.

Your previous success in reducing storage from 100GB gp2 to 20GB gp3 might have been possible because you were changing the storage type (from gp2 to gp3) along with the size reduction. However, in the current scenario, you're trying to reduce the size within the same storage type (gp3), which is not typically allowed.

To address this issue and reduce your costs, you might need to consider alternative approaches:

  1. Create a new RDS instance with the desired lower storage size and manually migrate your data.

  2. Use database export and import tools to move your data to a new instance with the desired configuration.

  3. Contact AWS support to see if they can assist with reducing the storage in your specific case.

Remember that when increasing allocated storage, it must be by at least 10% of the current size. However, decreasing allocated storage is not a standard operation and requires special handling as described above.

For future reference, it's important to carefully plan your initial storage allocation and maximum storage settings, as increasing these values can lead to situations where it becomes difficult to reduce them later.
Sources
Managing capacity automatically with Amazon RDS storage autoscaling - Amazon Relational Database Service
Amazon RDS Blue/Green Deployments support storage volume shrink - AWS
Increasing DB instance storage capacity - Amazon Relational Database Service
Reducing Allocated Storage for RDS Instance to Optimize Costs(Caused by Storage Autoscaling) | AWS re:Post

answered 2 years ago

  • ok, so if I change the type from gp3 to gp2 will the reduction happend or is there any case is there.

  • This is not true. You can indeed reduce the size from gp3 to gp3. I just did this. If there is a failure, it is usually because your allocated storage is not enough based on current usage. Even though Cloudwatch reported only 20GB used based on the free storage space metric, it failed when trying to reduce storage from 500GB to 50GB. But it succeeded when reducing from 500GB to 100GB. This is probably due to inconsistencies between how Cloudwatch calculates used space, and how the RDS instance/service itself calculates it. We probably could have gone with a value somewhere between 50GB and 100GB, but I was comfortable with the cost of 100GB and didn't want to recreate blue/green deployments to test if 60GB, 70GB, 80GB, etc. would work.

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.