###减少内存、磁盘IO的消耗,默认开启。
官方原文:
Values can range from 256MB to 10TB and can be a float. In addition, the default value has also changed.
Starting in 3.4, the WiredTiger internal cache, by default, will use the larger of either:
50% of RAM minus 1 GB, or
256 MB.
Avoid increasing the WiredTiger internal cache> With WiredTiger, MongoDB utilizes both the WiredTiger internal cache and the filesystem cache.
Via the filesystem cache, MongoDB automatically uses all free memory that is not used by the WiredTiger cache or by other processes. Data in the filesystem cache is compressed.
由此可以看出,在内存足够大的情况下,还是要以提高cpu性能为主,zlib虽然是最高压缩,但也最吃cpu另外,在存储引擎切换的时候,先从second开始,进入服务器,db.shutdownServer(),把服务器关掉,然后清空所有数据,然后配置wt引擎,然后在挂载回去,进行重新同步
官方的原文:http://docs.mongoing.com/manual-zh/tutorial/change-replica-set-wiredtiger.html 步骤
这个步骤将复制集中 secondary 的数据完全移除, 然后使用 WiredTiger 存储引擎重启 mongod, 利用:doc:`初始化同步 完成数据同步.
在升级复制集中的成员存储引擎时, 首先升级 secondary 成员. 然后将 primary 降级为从节点, 之后升级降级为从节点的成员.
1 Shut down the secondary member.
In the mongo shell, shut down the secondary mongod instance you wish to upgrade.
db.shutdownServer() 2 Prepare a data directory for the new mongod running with WiredTiger.
Prepare a data directory for the new mongod instance that will run with the WiredTiger storage engine.mongod must have read and write permissions for this directory. You can either delete the contents of the stopped secondary member’s current data directory or create a new directory entirely.
mongod with WiredTiger will not start with data files created with a different storage engine.
3 Start mongod with WiredTiger.
Start mongod, specifying wiredTiger as the --storageEngine and the prepared data directory for WiredTiger as the --dbpath. Specify additional options as appropriate for this replica set member.
mongod --storageEngine wiredTiger --dbpath --replSet
Since no data exists in the --dbpath, the mongod will perform an initial sync. The length of the initial sync process depends on the> You can also specify the options in a configuration file. To specify the storage engine, use thestorage.engine setting.
4 Repeat the procedure for other replica set secondaries you wish to upgrade.
Perform this procedure again for the rest of the secondary members of the replica set you wish to use the WiredTiger storage engine.