-
Type: Bug
-
Resolution: Done
-
Priority: Critical - P2
-
Affects Version/s: 3.0.3
-
Component/s: WiredTiger
-
None
-
Fully Compatible
-
ALL
-
-
Quint Iteration 5
ISSUE SUMMARY
WiredTiger does not store documents larger than its default leaf_value_max in the in-memory cache. The leaf_value_max value is 1 megabyte. As a result, operations that read or modify larger documents are significantly less efficient than with smaller documents.
Starting with MongoDB 3.0.5 all documents are stored in the in-memory WritedTiger cache, but this change only impacts collections created after upgrading to 3.0.5 or later. Existing collections are unaffected by this change.
USER IMPACT
Users running with the WiredTiger storage engine may observe slower performance when retrieving documents larger than 1 megabyte than when retrieving smaller documents.
WORKAROUNDS
Users with documents larger than 1 megabyte may use the --wiredTigerCollectionConfigString 'leaf_value_max=<bytes>' configuration option to increase the value of leaf_value_max beyond 1 megabyte to improve performance when accessing large documents.
For example, to ask WiredTiger to put in its cache documents of up to 16 megabytes in size, use:
--wiredTigerCollectionConfigString 'leaf_value_max=16000000'
Note that this setting only impacts collections created after the change. Existing collections are not be affected by this change, so users with existing collections containing large documents may want to move them to a newly created collection, replicate them to new instances running 3.0.5, or perform a dump + restore cycle on these collections.
AFFECTED VERSIONS
MongoDB 3.0.0 through 3.0.4.
FIX VERSION
The fix is included in the 3.0.5 production release.
Original description
Retrieval of large documents under MongoDB 3.0.3 and WiredTiger is significantly slower than 3.0.3 running MMAPv1. With the following reproduction on my macbook, I saw the following execution times, running the find() operation twice to account for cold data:
Engine | First find | Second find |
---|---|---|
MMAPv1 | 10ms | 0ms |
WiredTiger | 5950ms | 5921ms |
Increasing the leaf_value_max setting to 64000000 on mongod prior to collection creation improves performance:
Engine | First find | Second find |
---|---|---|
WiredTiger | 1803ms | 590ms |
- related to
-
SERVER-20197 find() on collection with large documents slower on WiredTiger than MMAPv1
- Closed