A brief introduction to Wiredtiger Engine tuning technology
22 Engine Contrast Concepts
Starting with 3.2.x, Wiredtiger becomes the default storage engine. The most popular storage engine in MongoDB today, Wiredtiger has the following advantages over the original MMAPV1:
1 Performance & Concurrency: Under most workloads, Wiredtiger performance is much higher than MMAPV1. The Wiredtiger engine is tailor-made for modern multicore systems to better leverage the processing power of multicore systems. The MMAPV1 engine uses table-level locks, so when there are concurrent operations on a single table, the throughput will be limited. Wiredtiger uses document-level locks, resulting in increased concurrency and throughput. For typical applications, cutting to the Wiredtiger engine provides 5-10 times the performance boost.
2 Compression & Encryption: The MMAPV1 engine requires data to be in memory and in the form of a disk (map disk memory map). Therefore, it does not support compression and encryption. Wiredtiger does not have this level of limitation and can be better supported.
3 Index prefix compression: Wiredtiger uses prefix compression when storing indexes--the same prefix is saved only once. The result is a smaller index and less use of physical memory.
4 Data storage mode: Two storage engines with different storage engines, there is no way to directly replace the software catalog for upgrade, only the initialization of resynchronization or import, WT engine production data and index files with WT, the JR log named Wiredtigerpreplog start 13 Wiredtiger parameters
A wiredtigercachesizegb=48
Meaning
1 CACHESIZEGB refers to the cache size, which includes data and indexes. Mongod itself using memory such as connection pool stack and sorting buffer are all extra and will not be counted into this number.
2 MongoDB requires additional memory for operations such as aggregation, sequencing, connection management, and so on. Therefore, you must ensure that there is enough memory available, otherwise the MONGODB process has the risk of being killed by Oom killer.
Like the MySQL Innodb_buffer_pool, the data index is in memory, and the sort requires extra memory.
2 Recommended Configurations
Server memory x75%
3 View Status Commands
Db.serverstatus (). Wiredtiger.cache
Two wiredtigerdirectoryforindexes=true
1 meanings
index files and data files are separated, indexed by a directory, a directory of data.
To the specific collection directory can be found
Collection Index two directories
Three Wiredtigerdirectoryforindexes=true
1 meanings
Whether to turn on index prefix compression, which affects all DB indexes. It stores all prefixes of the same index at once.
Reduces memory, disk IO consumption, and is turned on by default.
Four Wiredtigercollectionblockcompressor=snappy
1 meanings
What kind of compression default snappy does not recommend the use of Zlib mode, will increase the burden on the CPU
After five, some will continue to add
MongoDB 11th Article ~mongodb's engine interpretation