| 默认缓存 | max(50% × (RAM - 1GB), 256MB) |
|---|---|
| 配置项 | storage.wiredTiger.engineConfig.cacheSizeGB |
| 观察 | db.serverStatus().wiredTiger.cache |
读取缓存指标
读取缓存指标
const c = db.serverStatus().wiredTiger.cache
printjson({ current: c["bytes currently in the cache"], max: c["maximum bytes configured"], evicted: c["pages evicted by application threads"] })缓存限制的是引擎工作集而非总内存:连接、聚合与索引构建都在缓存之外占用内存。