Multiple MongoDb databases configuration -
I need to create a large number of MongoDb databases, some around 1000 +, later it will be more than 3000.
They will be hosted on a server with SSD discs and in most databases there are approximately 20-30 archives with more than 500 objects, most of the object size is between 10-50kb, then in the size of the data There will be a bit relatevely.
My question is how should I configure the creation of these mongodb databases, in order to use the disk space in the most effective way. I have read that mongodb allocates empty disk space and can take up to 100 MB in an empty database size, is there a way to reduce this size?
You can set the configuration option to True. This will shorten the initial data and journal files. From MongoDB Docs:
Storage. The Mallfiles option reduces the initial size for data files and limits the maximum size up to 512 megabytes Storage.smallFiles reduces the size of each journal file from 1 gigabyte to 128 megabytes. Use storage. If you have a large number of databases, then each data contains a small quantity.
Depending on your workload, you can also change it.
will use less storage space than the exact fit allocation
power of 2 (which is a default allocation strategy for v2.6 +).
Edit
Together with the
smallFiles option for an empty database (let's call it DB 01), Mongodi
will create two files which is 16 MB big:
- db01.0 -
As you add documents to your archive, MongoDB will create additional files for data with size: the next one is 32MB (db01.1), followed by a 64MB (db01. 2) will ... up to 512MB. Therefore, if you have only 50 MB of data (if you are worried about it) for your database, 1GB will not be undone like Mongodi.
If you are concerned about only disk size (on small SSD), you can also use. Each database will have its own directory, which you can link to any other disk.
Comments
Post a Comment