Skip to main content

CRE-2025-0113

MongoDB WiredTiger Cache OOM KillCritical
Impact: 10/10
Mitigation: 8/10

CRE-2025-0113View on GitHub

Description

Detects MongoDB Out-Of-Memory (OOM) kill caused by WiredTiger cache\npressure. This occurs when the cache fills with dirty pages faster\nthan they can be evicted, causing uncontrolled memory growth until\nthe OS kills the process.\n

Mitigation

IMMEDIATE ACTIONS:\n- Check if MongoDB restarted: `systemctl status mongod`\n- Verify data integrity: `db.runCommand({dbStats: 1})`\n- Check replica set status: `rs.status()`\n- Review memory configuration\n\nCACHE CONFIGURATION:\n- Increase WiredTiger cache size (default: 50% of RAM - 1GB)\n- Set explicit cache size: `--wiredTigerCacheSizeGB`\n- Tune eviction targets:\n * `wiredTigerEvictionTarget` (default: 80%)\n * `wiredTigerEvictionTrigger` (default: 95%)\n- Lower dirty eviction targets:\n * `wiredTigerEvictionDirtyTarget` (default: 5%)\n * `wiredTigerEvictionDirtyTrigger` (default: 20%)\n\nSYSTEM TUNING:\n- Add more system RAM\n- Set appropriate container memory limits\n- Configure swap space as safety net\n- Monitor memory usage continuously\n\nWORKLOAD OPTIMIZATION:\n- Reduce document sizes\n- Batch writes to reduce pressure\n- Use write concern `{w:1, j:false}` for non-critical data\n- Schedule index builds during low traffic\n

References