I'm not sure if this has already been asked but I'm facing a weird issue in MongoDB 4.2.8(Standalone).
We have a single collection running which uses a TTL index to delete all documents that are older than 24 hours.
Now the weird issue -
df -h shows the our external mongod volume as 94GB used,
du -hsx shows that the data is only 85GB and logs are 0KB.
Why is there a discrepancy of around 9GB on the disk?
I read that
db.compact could release free space to the OS but we need to be 100% sure there will be zero downtime with the operation.
Could anyone guide us on how to release the space with no downtime?
I just ran
db.stats() in my MongoDB instance this is the output -
"objects" : 74749716, "avgObjSize" : 3462.7832923539136, "dataSize" : 258842067673, "storageSize" : 85391945728, "numExtents" : 0, "indexes" : 13, "indexSize" : 3864145920, "scaleFactor" : 1, "fsUsedSize" : 100955877376, "fsTotalSize" : 107346903040, "ok" : 1
The question being how is storageSize and fsUsedSize different?