MongoDB problems

MongoDB WiredTiger Cache Full: When Operations Evict Pages Themselves

2 December 2026

WiredTiger keeps data and indexes in its cache, by default the larger of 50% of (RAM minus 1 GB) and 256 MB. Background threads keep it near 80% used, and 80% is normal. Trouble starts at 95% used or 20% dirty: then the threads that serve your operations stop to evict pages themselves, and every read and write waits for that.

Read the cache

const c = db.serverStatus().wiredTiger.cache;
({
  max_gb:   c["maximum bytes configured"] / 2**30,
  used_pct: 100 * c["bytes currently in the cache"]
                / c["maximum bytes configured"],
  dirty_pct: 100 * c["tracked dirty bytes in the cache"]
                 / c["maximum bytes configured"],
  app_evicted: c["pages evicted by application threads"]
})

Run it twice a minute apart. pages evicted by application threads that rises between the two is the sign: operations are doing the eviction.

The causes

CauseSign
Collection scansA query without an index reads a whole collection through the cache. COLLSCAN in the plan, rising collectionScans in serverStatus.
A working set larger than the cacheUsed stays at the top all day, not only in bursts.
A write burst on slow disksDirty climbs toward 20% because checkpoints cannot write fast enough.
Long transactionsOld versions of documents stay in the cache until the transaction ends.

The fix, in order

  1. Find the scan. db.currentOp({ "planSummary": /COLLSCAN/ }) shows the operations reading whole collections now. An index usually ends the pressure.
  2. Spread the writes. Load in batches, and give the data volume the throughput the write rate needs.
  3. End long transactions. transactionLifetimeLimitSeconds, 60 by default, bounds them; an application that raises it pays in cache.
  4. Add memory when the working set has grown. More RAM grows the default cache with it.
  5. Do not set cacheSizeGB to most of the RAM. The operating system's file cache and the connections need memory too.

See it coming

Radar Engine, the detection layer of dbCove, judges the cache the way WiredTiger does, on application-thread eviction, not on a used percentage, with no agent on the server:

DetectorWhen it fires
Cache pressureThe cache is full (95% used or 20% dirty) on 3 readings in a row with application threads evicting: Warning. Application threads evicting on all 3: Critical.
Operation loadOne operation shape holds half the active operations; the title says when it is a collection scan.
Latency riseReads, writes or commands on a member take 3 times their usual time.
Throughput dropOperations a second fall to a quarter of the usual while something is stalled; a full cache is one of the stalls it names.

The finding names the member, used and dirty percent, application evictions a second and the time spent evicting. dbCove AI finds the operation that filled the cache and proposes the index. It changes nothing without your click.

Questions

What is the default WiredTiger cache size?
The larger of 50% of (RAM minus 1 GB) and 256 MB.

Is 80% WiredTiger cache usage a problem?
No. WiredTiger keeps the cache near 80% by design. The problem starts at 95% used or 20% dirty, when application threads evict pages themselves.

How do I see what fills the MongoDB cache?
Look for collection scans with db.currentOp and the plan summary, and compare the size of the indexes and frequently read collections with the cache size.

Related problems

Sources