Mongodb 3.0 configuration
Mongodb 3.0 is a revolutionary version, thanks to the new version of the storage engine WiredTiger, which greatly improves performance as well as data compression (300%).
For performance comparison, see: https://comerford.cc/2015/02/04/mongodb-3-0-testing-compression/
Installation documentation: https://docs.mongodb.org/manual/administration/install-on-linux/
If you just install mongodb and start it, I'm sorry, it's still slow, and the default storage engine is still the old MMAPV1.
The default configuration of etc/mongo.conf is really commonplace, it is actually a text in yaml format, please replace it with the following configuration, you can change shotguns immediately.
SystemLog:
Destination: file
Path: / var/log/mongodb/mongod.log
LogAppend: true
ProcessManagement:
Fork: true
PidFilePath: / var/run/mongodb/mongod.pid
Net:
BindIp: 127.0.0.1
Port: 27017
Storage:
Journal:
Enabled: true
DbPath: / var/lib/mongo
DirectoryPerDB: true
SyncPeriodSecs: 60
Engine: wiredTiger
WiredTiger:
EngineConfig:
CacheSizeGB: 1
DirectoryForIndexes: false
JournalCompressor: snappy
CollectionConfig:
BlockCompressor: snappy
IndexConfig:
PrefixCompression: true
It is particularly important to note that yaml files do not support tab tabs, so pay special attention to paragraph file alignment, otherwise mongodb will fail to start.
Update 2016-04-16
The default storage engine of mongodb 3.2 has been changed to WiredTiger. It is recommended to use mongodb 3.2 directly.