wiredtiger support prewarm cache on restart ?

Skip to first unread message


Jul 19, 2021, 3:48:13 AM7/19/21
to wiredtiger-users

I find that mysql supports the dump&load of buffer pool at server shutdown&startup.
Postgresql has pg_prewarm & pg_hibernate feature to do the cache warming.

We've experiencing performance degradation during mongo server restart or adding a Secondary node. I think the same issue also exists in wiredtiger&mongo. I know Mirrored Reads and Hedged Reads, which seems to solve part of the problem. Especially do you consider Hedged Reads a kind of way of prewarming cache ?

Have wiredtiger&mongo considered making use of practices of mysql&pg to dump/load the cache (perhaps some percentage of page metadata), though it may need lots of work in wiredtiger ?


Aug 5, 2021, 2:39:00 AM8/5/21
to wiredtiger-users
I have the same question

Keith Bostic

Aug 5, 2021, 4:24:15 PM8/5/21
to wiredtiger-users

I don't know what happens at the MongoDB layer (for MongoDB questions, including questions about WiredTiger inside of the MongoDB engine, please use the MongoDB Community forums.)

That said, WiredTiger itself always prewarms the cache by loading the first internal page layers of each Btree on open (I think the argument there is (1) there aren't a lot of internal pages at high-levels of the tree, (2) they're almost certainly going to be useful, where as leaf pages might or might not be useful).

I haven't thought about this hard, but I don't think WiredTiger would actually need to "dump the cache"; the on-disk code we use (we call it the "block manager"), knows the pages that were recently written by reviewing the last checkpoint information for the file. While that certainly wouldn't be useful for all  workloads, it wouldn't be difficult in WiredTiger to figure out the pages that were recently written and read them back into cache on startup.

Reply all
Reply to author
0 new messages