简体   繁体   中英

How to check the available free space in mongodb

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM