At a glance
The share of page reads that WiredTiger, MongoDB’s default storage engine, served from its in-memory cache rather than going to disk. WiredTiger keeps recently used data and index pages in RAM; when a query needs a page that is already cached, the read is fast and cheap, and when it is not, WiredTiger must fault the page in from disk, which is orders of magnitude slower. This gauge is the single best summary of whether your working set fits in memory. A healthy deployment sits comfortably above 95%; the card turns red at <95% because a falling hit rate means more disk reads, climbing query latency, and a working set that has outgrown the cache.
Calculation
The gauge is derived from two byte counters inside thewiredTiger.cache sub-document of serverStatus:
bytes read into cacheis the cumulative volume WiredTiger has had to pull in from disk because the page was not already resident. Growth in this counter is the cost of cache misses.bytes currently in the cacheis the volume of data presently held in the WiredTiger cache, bounded by the configured cache size (by default roughly 50% of RAM minus 1 GB, or 256 MB, whichever is larger).- The ratio of “had to read from disk” against “what we are holding” inverts to a hit rate: the closer disk reads are to zero relative to the resident set, the closer the gauge is to 100%.
- This is the working-set fit signal. When the data and indexes your queries touch comfortably fit inside the cache, almost every page request is a hit and the gauge sits in the high nineties. When the working set exceeds the cache, WiredTiger constantly evicts and refaults pages, and the hit rate falls.
- Per-member. On a replica set the gauge reflects the member polled. A read-heavy secondary can have a very different hit rate from the primary because it is serving a different mix of queries.
- Counters are cumulative since last restart, so the live value is computed from the rate of change, not the absolute lifetime totals. A freshly restarted member shows a cold cache warming up: a temporarily low hit rate that recovers as pages fault in.
Worked example
A platform team runs a MongoDB 6.0 primary on a host with 32 GB RAM, leaving WiredTiger a default cache of roughly 15 GB. The deployment backs a product-catalogue and session service. Readings taken across a catalogue-import job on 11 Jun 26.
At 08:00 the working set fits comfortably inside the 15 GB cache and almost every read is a hit. When the catalogue import begins loading a large batch of previously cold documents, WiredTiger has to fault those pages in, so disk reads climb and the hit rate dips. By 14:10 the cache is full and the import is touching more distinct data than the cache can hold, so the engine evicts a page only to refault it moments later: classic cache thrashing. The gauge crosses 95% and the alert fires; by 14:40 the deployment is reading 620 MB/min from disk and query latency has roughly doubled.
- Immediate: if the dip is import-driven and transient, throttle or schedule the import off-peak so it does not evict the live working set during business hours. The hit rate recovers as soon as the cold batch finishes.
- Structural: if the hit rate sits below 95% even at baseline, the working set has genuinely outgrown the cache. Add RAM (and let the default cache sizing grow with it), or shrink the working set by adding or refining indexes so queries touch fewer pages, or shard to spread the working set across more cache.
- A low hit rate is a memory problem, not a query problem. The queries may be perfectly indexed; if the pages they need are not in cache, every read still pays the disk tax. Pair this with WiredTiger Dirty Cache % and the latency cards to confirm the cause.
- A cold cache after a restart is expected. A member that has just restarted or failed over reads from disk until its cache warms, so a temporary dip right after a maintenance event is normal and self-corrects.
- 95% is a meaningful line for OLTP workloads. Below it, the disk-read rate climbs fast enough to move user-facing latency. Treat a sustained red reading as “the working set no longer fits”, which is a capacity decision, not a tuning tweak.
Sibling cards to read alongside
Reconciling against the source
Where to confirm the number in MongoDB’s own tooling:Why our number may legitimately differ from the native view:mongosh:db.serverStatus().wiredTiger.cachereturns the full cache document, including"bytes read into cache","bytes currently in the cache","maximum bytes configured", and the dirty-byte counters. Sample it twice and compute the ratio on the deltas to reproduce this gauge.mongostat: does not show hit rate directly, but theusedanddirtycache-percentage columns give a quick read on cache pressure alongside this card. Atlas: the Metrics tab has Cache Activity and Cache Usage charts; the “bytes read into cache” series is the disk-fault rate that drives this hit rate down.db.serverStatus().wiredTiger: the broader document also exposes eviction and page-fault counters that explain why a hit rate is falling.
Cross-connector reconciliation:
Known limitations / FAQs
Why is my hit rate low right after a restart or failover? The WiredTiger cache starts empty after themongod process restarts, so the first wave of queries must fault their pages in from disk. This is a cold cache warming up, and the hit rate recovers as the working set becomes resident again. A dip in the minutes following a maintenance event or election is expected and self-correcting; only a hit rate that stays low once traffic has settled is a real signal.
The hit rate is fine but queries are still slow. Why?
A high cache hit rate only tells you reads are being served from memory; it says nothing about whether the queries themselves are efficient. A missing index forcing a collection scan can be fast in the sense that every page is cached, yet still slow because it examines far more documents than it returns. Pair this card with COLLSCAN Operations (24h) and the latency cards to separate a memory problem from a query-plan problem.
Does this include the operating-system page cache?
No. This gauge measures the WiredTiger application-level cache only. Below WiredTiger, the operating system maintains its own page cache, so a “miss” at the WiredTiger layer may still be served from OS RAM rather than physical disk. That means real disk I/O can be lower than the raw miss rate implies, but for tuning purposes the WiredTiger hit rate is the actionable layer because it is what MongoDB controls.
How do I raise the hit rate?
Three levers, in order of leverage. First, fit the working set in cache: add RAM (the default cache grows with it) so the data and indexes your queries touch stay resident. Second, shrink the working set: add or refine indexes so queries touch fewer pages, and remove unused indexes that waste cache. Third, isolate churn: schedule large imports, exports, and analytical scans off-peak so they do not evict the live working set during business hours.
Why does a secondary show a different hit rate from the primary?
Cache contents are per-member and reflect the queries each member actually serves. A secondary handling analytical or read-preference traffic warms a different set of pages from a primary handling writes and primary reads, so their hit rates diverge naturally. If you route reads to secondaries, monitor their hit rate separately, because a read-heavy secondary can thrash its cache while the primary looks healthy.
Can a single large query tank the hit rate?
Yes. A query that scans a large collection or rebuilds a big index pulls a large volume of cold pages into the cache, evicting the live working set to make room. The hit rate dips during the operation and recovers afterwards. If this is recurring, the offending operation usually appears in Top 10 Slow Operations; the fix is to index it so it stops scanning, or to run it off-peak.