Sample Header Ad - 728x90

First query is really slow with WiredTiger, not with mmapv1

1 vote
1 answer
1168 views
We recently upgraded to MongoDB 4.0. Loving the performance improvements with WiredTiger, but all of a sudden our test suite is timing out on certain machines. Before running our tests, we run the following command:
mongod --dbpath ./.test-data --bind_ip 127.0.0.1 --fork --logpath ../testlog.txt
Everything seems great. The database starts. Node connects to it. We create a bunch of collections and indexes. Then once we run the first query, it takes 10+ seconds to run. To be clear, at this point the database has never had any data inserted into it. It's brand new. Using MMAPv1 (with the following command) resolves the problem, but I think it'd be great to run our tests with WiredTiger, if possible.
mongod --dbpath ./.test-data --storageEngine mmapv1 --bind_ip 127.0.0.1 --fork --logpath ../testlog.txt
Running mongod v4.0.3 and OS X 10.13.6. Connecting with node v6.9.1 and mongoose v5.4.19. After each test run, we nuke the data directory:
mongo admin --eval 'db.shutdownServer()' > /dev/null
rm -rf ./.test-data/*
I also tried setting --wiredTigerJournalCompressor none --wiredTigerCacheSizeGB 1.0 --wiredTigerCollectionBlockCompressor none --wiredTigerIndexPrefixCompression false and it didn't make a difference.
Asked by Andrew Rasmussen (119 rep)
Apr 4, 2019, 09:57 AM
Last activity: Mar 1, 2020, 05:00 AM