Configuring MongoDB for a production deployment
In this recipe, we will look at important factors that should be configured when setting up a MongoDB instance. These include MongoDB as well as operating system parameters.
Getting ready
You will need MongoDB binaries and a Linux operating system.
How to do it...
It is highly recommended by MongoDB that you choose the XFS filesystem over Ext4, especially when using the WiredTiger storage engine. It provides concurrent disk I/O, as well as extends (reduced fragmentation-based allocation of data), which provide significant performance improvement over Ext4. To create an XFS-based volume, simply do the following:
- Install XFS tools:
apt-get install xfsprogs
- Create the XFS filesystem:
mkfs.xfs /dev/<device-name>
- Always choose an SSD over a mechanical disk. Additionally, make sure you measure the disk's performance using either the
mongoperf
utility, as shown in the Measuring disk I/O performance with mongoperf recipe in Chapter 3, Performance Tuning...