Run a MongoDB configuration server without 3GB of journal files

journallingmongodbreplicationsharding

For a production sharded MongoDB installation we need 3 configuration servers.
According to the documentation "the config server mongod process is fairly lightweight and can be ran on machines performing other work". However, in the default configuration, they all have journalling enabled, and with preallocation this takes up 3 GB of disk space. I assume that the actual data and transaction volume of a config server is quite small, so that this seems a bit too much.

Is there a way to (safely!) run these config servers with much less disk use for the journal?
Do I need journalling at all on config servers? Can I set the journal size to be smaller?

Best Answer

Yes - there is a way to minimize the default size of the journal files, subject to a couple of caveats. From the MongoDB configuration documentation:

To reduce the impact of the journaling on disk usage, you can leave journal enabled, and set smallfiles to true to reduce the size of the data and journal files.

Here is the smallfiles config information:

Set to true to modify MongoDB to use a smaller default data file size. Specifically, smallfiles reduces the initial size for data files and limits them to 512 megabytes. The smallfiles setting also reduces the size of each journal files from 1 gigabyte to 128 megabytes.

Use the smallfiles setting if you have a large number of databases that each hold a small quantity of data. The smallfiles setting can lead mongod to create many files, which may affect performance for larger databases.

Related Topic