wiredtiger cache performance

133 views
Skip to first unread message

Brian Dentino

unread,
Aug 17, 2017, 3:32:01 PM8/17/17
to mongodb-user
I am trying to diagnose some intermittent performance issues we've been experiencing with our application over the past few days. I have noticed that these issues are correlated with high levels of mongodb cache activity and page faults. What seems unusual about this to me is that the cache is configured for up to 37GB of memory, and is not even using 30GB. Is this normal to see heavy cache activity like this when the cache isn't even close to full?

I've attached graphs of cache activity, page faults, and cache size. Any guidance would be very much appreciated.

Screen Shot 2017-08-16 at 9.02.58 PM.png

Weishan Ang

unread,
Aug 19, 2017, 7:35:31 PM8/19/17
to mongodb-user
Hi Brian,

Can you define cache activity please? Is it cache eviction?

There are 2 parameters that will trigger cache eviction. eviction_dirty_trigger and eviction_trigger.I believe the default trigger point is 95% and 20%.

Kevin Adistambha

unread,
Aug 22, 2017, 2:12:11 AM8/22/17
to mongodb-user

Hi Brian

the cache is configured for up to 37GB of memory, and is not even using 30GB

This is expected, since the WiredTiger storage engine will try to keep cache usage to ~80% of configured WiredTiger cache, which in your case is 37 * 0.8 = 29.6 GB. Please note that the WiredTiger cache setting of 37 GB doesn’t mean that WiredTiger will reserve 37 GB all at once. Rather, it will use maximum of 37 GB. The extra 20% was to allow a leeway for any unexpected workloads that put sudden pressure on the cache.

Is this normal to see heavy cache activity like this when the cache isn’t even close to full?

Yes. What the graph is telling you is that WiredTiger needs to load more data from disk into its cache. A typical cause of this spike in cache activity is a change in workload, or a collection scan query. A collection scan query is quite disruptive to the cache, and could cause the intermittent performance issue you observed. Please see Explain Results page for more information.

Best regards,
Kevin

Reply all
Reply to author
Forward
0 new messages