Reduce atlas storage which has big freeStorageSize


I am writing to inquire about how Atlas works when reducing storage size. We are currently using MongoDB Atlas with AWS provider and have 184GB of free storage size out of 216GB storage size.

In this situation, do we need to execute “compact” on each node before changing the storage in the cluster configuration, or can Atlas handle the free storage size without needing to perform compaction?

Thanks for reading this and I’ll wait for your response. :smile:

Hi @Hyun_Yun - Welcome to the community :wave:

All Atlas deployments are running on the WiredTiger storage engine. WiredTiger is a no-overwrite data engine, and only releases disk space when blocks available for reuse are checked and used for the writing of new blocks before the file is extended. There is no need to forcibly compact your data, as WiredTiger manages this for you.

So in terms of whether you “need” to execute compact() or not depends on what you’re after. E.g. Are you planning to reduce the storage configuration for the cluster once you have reclaimed the disk space?


Hello @Jason_Tran

Thank you so much for kind reply.
We are planning reclaim disk space.

Should we run compact first?

Hi Hyun,

Just to clarify, after reclaiming disk space, what is your goal? Are you attempting to scale the storage down for the cluster?


Hello @Jason_Tran

The goal of the question is that we have a disk size that is too large for the actual data size.

We would like to reduce the configured disk size in the cluster.

Just out of curiosity, it might be helpful if we run compact before downgrading.

Thanks you

Thanks for confirming Hyun,

There are some other posts where users have compacted the secondary(s) first (one by one) before compacting the primary:

If you run into any particular issues with your cluster you can try contacting the Atlas in-app chat support team.


Thank you so much

Your comments are very helpful!
It is really appreciated.

Thank you.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.