mongodb - MongoDb/GridFs(C# 驱动程序):WiredTiger 缓存问题/问题
问题描述
我最近一直在用 GridFs(C# 驱动程序)进行测试,并遇到了一个问题,在上传了大约 100k 个文件后,每个文件的权重约为 1.5mb(有些是 50mb+,有些是 ~200kb):Mongodb 服务器的内存消耗上升到 ~6.5 Gb 和 ~6Gb 仅用于有线老虎缓存(db.serverstatus().wiredTiger.cache.bytes 当前在缓存中)。另一个问题是,在从 fs.files 和 fs.chunks 中删除所有文档并重新启动服务器后,有线 Tiger 缓存仍然是 ~6Gb,这导致该进程坚持使用 6.5Gb RAM。
我的问题是:
- 这种数量的文件通常是这种缓存大小吗?
- 有线老虎如何/何时清空/驱逐它的缓存?
- 有什么方法可以在不影响性能的情况下对其进行调整?
规格:MongoDb 服务器 4.2(未配置 storage.wiredTiger.engineConfig.cacheSizeGB),C#/GridFs 驱动程序 2.9,Windows 10(16Gb RAM)
非常感谢 !
"cache" : {
"application threads page read from disk to cache count" : 11456,
"application threads page read from disk to cache time (usecs)" : 3922601,
"application threads page write from cache to disk count" : 49,
"application threads page write from cache to disk time (usecs)" : 6539,
"bytes belonging to page images in the cache" : 6314172728.0,
"bytes belonging to the cache overflow table in the cache" : 182,
"bytes currently in the cache" : 6315679556.0,
"bytes dirty in the cache cumulative" : 475772,
"bytes not belonging to page images in the cache" : 1506827,
"bytes read into cache" : 9863425672.0,
"bytes written from cache" : 399800,
"cache overflow cursor application thread wait time (usecs)" : 0,
"cache overflow cursor internal thread wait time (usecs)" : 0,
"cache overflow score" : 0,
"cache overflow table entries" : 0,
"cache overflow table insert calls" : 0,
"cache overflow table max on-disk size" : 0,
"cache overflow table on-disk size" : 0,
"cache overflow table remove calls" : 0,
"checkpoint blocked page eviction" : 0,
"eviction calls to get a page" : 5335,
"eviction calls to get a page found queue empty" : 56,
"eviction calls to get a page found queue empty after locking" : 105,
"eviction currently operating in aggressive mode" : 0,
"eviction empty score" : 0,
"eviction passes of a file" : 112,
"eviction server candidate queue empty when topping up" : 25,
"eviction server candidate queue not empty when topping up" : 87,
"eviction server evicting pages" : 0,
"eviction server slept, because we did not make progress with eviction" : 468,
"eviction server unable to reach eviction goal" : 0,
"eviction server waiting for a leaf page" : 25876,
"eviction state" : 128,
"eviction walk target pages histogram - 0-9" : 0,
"eviction walk target pages histogram - 10-31" : 0,
"eviction walk target pages histogram - 128 and higher" : 0,
"eviction walk target pages histogram - 32-63" : 0,
"eviction walk target pages histogram - 64-128" : 112,
"eviction walk target strategy both clean and dirty pages" : 0,
"eviction walk target strategy only clean pages" : 112,
"eviction walk target strategy only dirty pages" : 0,
"eviction walks abandoned" : 6,
"eviction walks gave up because they restarted their walk twice" : 0,
"eviction walks gave up because they saw too many pages and found no candidates" : 0,
"eviction walks gave up because they saw too many pages and found too few candidates" : 0,
"eviction walks reached end of tree" : 6,
"eviction walks started from root of tree" : 6,
"eviction walks started from saved location in tree" : 106,
"eviction worker thread active" : 4,
"eviction worker thread created" : 0,
"eviction worker thread evicting pages" : 5177,
"eviction worker thread removed" : 0,
"eviction worker thread stable number" : 0,
"files with active eviction walks" : 0,
"files with new eviction walks started" : 6,
"force re-tuning of eviction workers once in a while" : 0,
"forced eviction - pages evicted that were clean count" : 0,
"forced eviction - pages evicted that were clean time (usecs)" : 0,
"forced eviction - pages evicted that were dirty count" : 0,
"forced eviction - pages evicted that were dirty time (usecs)" : 0,
"forced eviction - pages selected because of too many deleted items count" : 0,
"forced eviction - pages selected count" : 0,
"forced eviction - pages selected unable to be evicted count" : 0,
"forced eviction - pages selected unable to be evicted time" : 0,
"hazard pointer blocked page eviction" : 0,
"hazard pointer check calls" : 5173,
"hazard pointer check entries walked" : 27762,
"hazard pointer maximum array length" : 3,
"in-memory page passed criteria to be split" : 0,
"in-memory page splits" : 0,
"internal pages evicted" : 0,
"internal pages queued for eviction" : 0,
"internal pages seen by eviction walk" : 246,
"internal pages seen by eviction walk that are already queued" : 0,
"internal pages split during eviction" : 0,
"leaf pages split during eviction" : 0,
"maximum bytes configured" : 7990149120.0,
"maximum page size at eviction" : 0,
"modified pages evicted" : 0,
"modified pages evicted by application threads" : 0,
"operations timed out waiting for space in cache" : 0,
"overflow pages read into cache" : 0,
"page split during eviction deepened the tree" : 0,
"page written requiring cache overflow records" : 0,
"pages currently held in the cache" : 6306,
"pages evicted by application threads" : 2,
"pages queued for eviction" : 11200,
"pages queued for eviction post lru sorting" : 10953,
"pages queued for urgent eviction" : 704,
"pages queued for urgent eviction during walk" : 0,
"pages read into cache" : 11478,
"pages read into cache after truncate" : 2,
"pages read into cache after truncate in prepare state" : 0,
"pages read into cache requiring cache overflow entries" : 0,
"pages read into cache requiring cache overflow for checkpoint" : 0,
"pages read into cache skipping older cache overflow entries" : 0,
"pages read into cache with skipped cache overflow entries needed later" : 0,
"pages read into cache with skipped cache overflow entries needed later by checkpoint" : 0,
"pages requested from the cache" : 14583,
"pages seen by eviction walk" : 13301,
"pages seen by eviction walk that are already queued" : 1855,
"pages selected for eviction unable to be evicted" : 4,
"pages selected for eviction unable to be evicted as the parent page has overflow items" : 0,
"pages selected for eviction unable to be evicted because of active children on an internal page" : 4,
"pages selected for eviction unable to be evicted because of failure in reconciliation" : 0,
"pages selected for eviction unable to be evicted due to newer modifications on a clean page" : 0,
"pages walked for eviction" : 24882,
"pages written from cache" : 52,
"pages written requiring in-memory restoration" : 0,
"percentage overhead" : 8,
"tracked bytes belonging to internal pages in the cache" : 1000672,
"tracked bytes belonging to leaf pages in the cache" : 6314678884.0,
"tracked dirty bytes in the cache" : 120312,
"tracked dirty pages in the cache" : 7,
"unmodified pages evicted" : 5175
},
解决方案
数据库将使用机器上可用的内存。
您的统计数据显示 mongodb 使用的内存不到一半,这反映了 MongoDB 文档。
有多种旋钮可用于有线老虎缓存大小。
推荐阅读
- numbers - 实数自然吗?
- ionic-framework - Ionic 3- 向下滚动时隐藏导航栏和选项卡,向上滚动时显示
- angular - Angular2如何做highchart tootip格式化程序 - 附加值
- javascript - 如何实现代码镜像以在没有 CTRL+SPACE 的情况下显示提示
- jquery - 由于大字符串数据参数,jQuery/ajax 调用未命中控制器
- django - ManyToMany 不保存到 db Django
- apache-spark - 如何从 Spark 中的“在平方误差的集合内”值计算 K-means 聚类模型的准确性?
- javascript - 单击提交按钮时,文本字段值未出现在 Javascript 中......在 nodejs 中使用 eembeddable 小部件
- android - ionic cordova build android 找不到模块'../pages/Wallet/'
- nginx - Nginx - 重定向或重写 url