Just wanted to understand.
I’ve just installed mongodb to test it on Windows OS. For each DB it creates 2 files: dbname.0 and dbname.ns
these db files have constant initial size (dbname.0 – 67MB and dbname.ns 16MB)
Is it normal and if yes why?
Thanks!
Yes, this is normal – these are the pre-allocated datafile and the namespace file.
dbname.0 is the pre-allocated initial datafile , which starts with 64MB
dbname.ns is for book-keeping. ns stands for namespace. The default limit for the 16MB .ns file supports 24,000 namespaces (collections + indexes) (see: –nssize parameter)
whenever MongoDB grows beyond the size of the last dbname.x file, it allocates a new data file with twice the size, up to size 2GB. Once the file size reaches 2GB, each successive file is also 2GB.
See:
http://www.mongodb.org/display/DOCS/Using+a+Large+Number+of+Collections
http://www.mongodb.org/display/DOCS/Developer+FAQ
http://www.mongodb.org/display/DOCS/Excessive+Disk+Space
http://comments.gmane.org/gmane.comp.db.mongodb.user/49819
Also:
How many collections are possible in a MongoDB without losing performance?