By default, Percona Server for MongoDB runs with WiredTiger. There is also the original MMAPv1 storage engine, as well as optional Percona Memory Engine and MongoRocks storage engines to choose from. Each one is designed for specific purposes and workloads.
You can select a storage engine
--storageEngine command-line option when you start
Alternatively, you can set the
in the configuration file (by default,
Data created by one storage engine is not compatible with other storage engines, because each one has its own data model. When changing the storage engine, you have to do one of the following:
If you simply want to temporarily test a storage engine,
you can change to a different data directory
--dbpath command-line option:
$ service mongod stop $ mongod --storageEngine rocksdb --dbpath <dataDirForRocksDB>
Make sure that the user running
has read and write permissons for the new data directory.
If you want to permanently switch to a different storage engine and do not have any valuable data in your database, clean out the default data directory and edit the configuration file:
$ service mongod stop $ rm -rf /var/lib/mongodb/* $ sed -i '/engine: \*rocksdb/s/#//g' /etc/mongod.conf $ service mongod start
If there is data that you want to migrate and make compatible with the new
storage engine, use the
$ mongodump --out <dumpDir> $ service mongod stop $ rm -rf /var/lib/mongodb/* $ sed -i '/engine: \*rocksdb/s/#//g' /etc/mongod.conf $ service mongod start $ mongorestore <dumpDir>
The default configuration file provided with Percona Server for MongoDB (
contains templates for running any of the bundled storage engine.
The suggested values do not cover all cases,
but they are a good reference point to start customizing the configuration.
The following hints may help you:
trueto use a smaller default file size, if you have a large number of databases that each holds a small amount of data.
storage.rocksdb.countersvariable must be set to
trueif you are running MongoRocks and want to use Percona Monitoring and Management.
For general inquiries, please send us your question and someone will contact you.