I’ve been deleting data to reduce disk space, but even though my data size goes down, index size goes UP even more!
I’ve been led to believe I should compact or rebuild affected indexes, but this doesn’t seem to be possible on an M0 Shared instance; I get a lot of CMD_NOT_ALLOWED?
In January I couldn’t fix this without deleting the entire cluster. Is that my only option, still?
Hello @David_Young!
Didn’t see your first post, I’m sorry.
Here there are some commands that you can’t run in your free cluster: https://www.mongodb.com/docs/atlas/unsupported-commands/.
For curiosity, what type of indexes are?
I will answer as soon as posible.
I’m not very familiar with the indexing situation, as I’m not the original developer, and although I’m experienced with relational storage, I’m still new to mongo.
The breakdown of available capacity is as follows:
Collections storage: 21%
Collections indexes: 30%
Collections logical total: 60%
Cluster logical total: 90%
So 39% of available space is unaccounted for, some of which will be from bulk deletions.
If I keep writing to this cluster, will it reclaim the deleted space? Will fragmented indexes eventually rebuild automatically, since I can’t do it manually?
Hello!
I don’t think so… You must keep in mind that a M0 Shared Instance is so limitated, not only in hardware aspects, but also in administration.
I have found other discussion that can help you to answer your question: How to get fragmentation stats in mongo/wiredtiger mongo version 4.4
I hope i have help you with this link. If you have any doubts, please let me know them.
I already know it’s fragmented from the stats I already have, and the fact that I’ve deleted a lot of the data.
My question really amounts to: how can a shared instance be used sustainably? How can we know if it’s about to stop accepting writes, and how are we allowed to rectify that condition? I am already getting warnings and there appears to be no way to clear them.
So, as I understand, your StorageSize is bigger than DataSize. If this is true, MongoDB will place new documents in this space that “is not used”.
In a scenario that you want to “shrink” the size that MongoDB has but is not used, you can do an inital sync or to create a dump archive with mongodump
, drop the database, and then restore it with mongorestore
.
The best way to do this is through compact
command but for M0 cluster tier it is limitated.