首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何配置Mongodb的缓存大小?

问如何配置Mongodb的缓存大小?
EN

Stack Overflow用户
提问于 2015-10-01 22:20:03
回答 3查看 7.7K关注 0票数 1

我需要处理现金在Mongodb.Does它需要很多内存来做这件事?在这种情况下使用存储引擎的特点和优势是什么?

EN

回答 3

Stack Overflow用户

发布于 2018-04-19 17:15:04

  1. 方法(重启后无法存活):

./bin/mongo admin

"cache_size=10G"}) ({ "setParameter":1,"wiredTigerEngineRuntimeConfig":db.adminCommand

  1. 启动mongodb服务

./bin/mongod -配置server.conf --wiredTigerCacheSizeGB=10

- server.conf (一行一个键/值)

代码语言:javascript
复制
maxConns=200
logpath=logs/server.log
logappend=true
fork=true
dbpath=data
nohttpinterface=true
syncdelay=60
quiet = true
slowms = 2000
notablescan = false

使用以下命令检查大小:

代码语言:javascript
复制
> db.serverStatus().wiredTiger.cache
{
        "bytes currently in the cache" : 4606522365,
        "bytes read into cache" : 3291056,
        "bytes written from cache" : 5631783282,
        "checkpoint blocked page eviction" : 0,
        "eviction currently operating in aggressive mode" : 0,
        "eviction server candidate queue empty when topping up" : 448,
        "eviction server candidate queue not empty when topping up" : 0,
        "eviction server evicting pages" : 0,
        "eviction server populating queue, but not evicting pages" : 447,
        "eviction server unable to reach eviction goal" : 0,
        "eviction worker thread evicting pages" : 12,
        "failed eviction of pages that exceeded the in-memory maximum" : 0,
        "files with active eviction walks" : 0,
        "files with new eviction walks started" : 105,
        "hazard pointer blocked page eviction" : 0,
        "in-memory page passed criteria to be split" : 896,
        "in-memory page splits" : 448,
        "internal pages evicted" : 0,
        "internal pages split during eviction" : 0,
        "leaf pages split during eviction" : 13,
        "lookaside table insert calls" : 0,
        "lookaside table remove calls" : 0,
        "maximum bytes configured" : 10737418240,  <---- this is the configured size
        "maximum page size at eviction" : 8388576,
        "modified pages evicted" : 13,
        "modified pages evicted by application threads" : 0,
        "page split during eviction deepened the tree" : 0,
        "page written requiring lookaside records" : 0,
        "pages currently held in the cache" : 675,
        "pages evicted because they exceeded the in-memory maximum" : 1,
        "pages evicted because they had chains of deleted items" : 448,
        "pages evicted by application threads" : 0,
        "pages queued for eviction" : 12,
        "pages queued for urgent eviction" : 0,
        "pages read into cache" : 234,
        "pages read into cache requiring lookaside entries" : 0,
        "pages seen by eviction walk" : 25702,
        "pages selected for eviction unable to be evicted" : 0,
        "pages walked for eviction" : 127975,
        "pages written from cache" : 310352,
        "pages written requiring in-memory restoration" : 0,
        "percentage overhead" : 8,
        "tracked bytes belonging to internal pages in the cache" : 316858,
        "tracked bytes belonging to leaf pages in the cache" : 4606205507,
        "tracked bytes belonging to overflow pages in the cache" : 0,
        "tracked dirty bytes in the cache" : 809239633,
        "tracked dirty pages in the cache" : 190,
        "unmodified pages evicted" : 0
}
票数 7
EN

Stack Overflow用户

发布于 2019-10-02 23:43:33

以GB为单位的WT缓存大小的更简明输出为:

Db.serverStatus().wiredTiger.cache“配置的最大字节数”/1024/1024/1024 64

票数 1
EN

Stack Overflow用户

发布于 2015-10-01 22:32:59

Dba是合适的地方。如果您正在使用WiredTiger,使用所有可用的内存,并使用dynamic provisioning,则已经定义了缓存。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32889947

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档