Saturday, 15 January 2011

mongodb - db.repairDatabase() did not reduce size of database -


I have a DB which is about 8G. I copied DB to copy, then I used JS Console Taken off the tax per cut. Then I started a rapper db and the copy is still the exact size as the original.

In all likelihood, this means that you have enough access to the OS or the file back Have not left the place. Imagine that you have five 2 GB files (after the first small files, Mongodi has allocated files in 2 GB pay scale) and now imagine that you had 8 GB data in this DB, the last file is always empty because the Monodibi undoes a file before it is needed. Therefore 8 GB four 2 GB files are captured and a 2 GB file is empty.

Now you sort a bit - maybe 1.8 GB of stuff should also be removed. You run repair db, which rewrites every single record, as is possible in a new set of database files. Except that the same 5 2 GB files are still required because the fourth file has 100 MB of data and the last file is always empty.

You can see the output of DB.States (), whether the size of the data is compared to storage size, but the fact is that these are relatively small numbers compared to the size of allotted files and You are probably looking at what you are seeing.

No comments:

Post a Comment