9

I am newly starting on mongodb. I know that by default, mongodb pre allocated data files in the order of 64MB, 128MB, 256MB, ....2GB, 2GB, 2GB....etc

Now let us supposed i have a mongo instance that is preallocated with 64MB and 128MB for each of the different collections. Now I would like to know the below

  • How to check the available free space in the 128MB file of each collections?
  • How to check the total size of all the collections, data bases?
  • How to check the total available free space out of allocated?
0

1 Answer 1

5

Checking free space in the internal storage files of mongo is not something you normally (or at all) do.

Mongo provides a number of functions which you can use to check the size of collections and some helpful scripts demonstrating how to run the functions on each database on the server.

You can also wrap such functions in a script to make reading easier, such as this script which lists the size and counts for all collections in a database.

1
  • Ya... I agree with the first statememt. in case of pre allocation it can hardly be a value less than 2GB.
    – Uday
    Jan 30, 2012 at 12:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.