首页 > 数据库 >Mongodb修改oplog大小--笔记

Mongodb修改oplog大小--笔记

时间:2022-11-02 18:23:55浏览次数:62  
标签:-- Mongodb cache page eviction oplog pages size

MongoDB 3.6之前oplog修改需要重启实例到非副本单实例模式,3.6开始可以使用命令replSetResizeOplog在线修改副本集成员的oplog大小。
修改方式为:先修改从secondary节点开,然后依次到主节点。
本文测试环境为MongoDB 4.2.5-5

1、MongoDB 3.6之前非在线修改步骤
查看oplog大小
db.getReplicationInfo()
rs.printReplicationInfo()

use local
db.oplog.rs.stats().maxSize

maxSize字段以字节为单位显示集合大小,可以看到当前节点oplog大小为maxSize kb/1024/1024=maxSize MB
说明:
计算机中的信息都是二进制的0和1来表示,其中每一个0或1被称作一个位,用小写b表示,即bit(位)
大写B表示byte,即字节,一个字节=八个位,即1B=8b
1MB=1024KB,1KB=1024Byte


关闭mongodb实例
db.shutdownServer()
以单节点模式(不包含 --replSet 参数)重新启动该 mongod 实例 。
命令如下:
mongod --port 29017 --dbpath /data/mongod27030/db

备份现有的Oplog(可选)
我们可以选择备份该节点现有的oplog来以防万一,命令如下:
mongodump --db local --collection 'oplog.rs' --port 29017 

以新的大小重建oplog
保存oplog中最新的条目,以便副本方式启动后可以接上复制点位
例如,连接进入 mongo 窗口,并通过如下命令进入 local 数据库:

保存到rsOplogTemp
通过删除 rsOplogTemp表来确保其是空的:
use local
db.rsOplogTemp.drop()
使用 natural order 排序来找到oplog中最后一条数据,并通过 db.collection.save() 命令插入rsOplogTemp表中:
db.rsOplogTemp.save( db.oplog.rs.find( { }, { ts: 1, h: 1 } ).sort( {$natural : -1} ).limit(1).next() )
通过如下命令来查看oplog的保存结果:
db.rsOplogTemp.find()

删除已存在的Oplog
通过如下命令在 local 数据库中删除老的 oplog.rs 集合:
db = db.getSiblingDB('local')
db.oplog.rs.drop()
会返回 true

建立新的Oplog
通过 create 命令来建立新的oplog(新的大小)。 指定 size (单位为bytes)。下面的命令会建立一个 大小为 50 * 1024 * 1024 * 1024 也就是50G的oplog:

db.runCommand( { create: "oplog.rs", capped: true, size: (50* 1024 * 1024 * 1024) } )
成功后会返回如下内容:
{ "ok" : 1 }

将就备份Oplog的最后的条目插入新的Oplog中
将之前存好的老的oplog的最新的条目插入新的oplog中。例如:
db.oplog.rs.save( db.rsOplogTemp.findOne() )
通过如下命令来确认:
db.oplog.rs.find()

以复制集模式重启 mongod 实例

在所有从节点上重复该操作


最后再在主节点上进行该操作

把主变为从节点命令
rs.stepDown()


修改主节点的Oplog大小和
use local
db.rsOplogTemp.drop()
db.rsOplogTemp.save( db.oplog.rs.find( { }, { ts: 1, h: 1 } ).sort( {$natural : -1} ).limit(1).next() )
db.rsOplogTemp.find()

db.oplog.rs.drop()
db.oplog.rs.save( db.rsOplogTemp.findOne() )
db.oplog.rs.find()

2、MongoDB 3.6之后在线修改步骤
在线修改就简单多了,不用重启实例直接修改即可
同样先修改从再修改主节点

查看oplog大小
db.getReplicationInfo()
rs.printReplicationInfo()

use local
db.oplog.rs.stats().maxSize

在线设置oplog命令(修改为200G)
db.adminCommand({replSetResizeOplog: 1, size: (200* 1024 * 1024 * 1024)})

 

只列出修改主节点具体过程:

$ mongo.27030.login
Percona Server for MongoDB shell version v4.2.5-5
connecting to: mongodb://127.0.0.1:27030/admin?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("071767d1-48a1-4811-bd38-19ea91834275") }
Percona Server for MongoDB server version: v4.2.5-5
type "help" for help
Server has startup warnings: 
2020-09-14T16:54:56.021+0800 I  STORAGE  [initandlisten] 
2020-09-14T16:54:56.021+0800 I  STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2020-09-14T16:54:56.021+0800 I  STORAGE  [initandlisten] **          See http://dochub.mongodb.org/core/prodnotes-filesystem
pricing:PRIMARY> show dbs;
admin                     0.000GB
config                    0.016GB
db_hlf                    0.000GB
insightToPricingTempDB   60.518GB
local                     7.405GB
meb_backup                0.000GB
pricing                 656.418GB
pricing:PRIMARY> use local
switched to db local
pricing:PRIMARY> 
pricing:PRIMARY> show tables;
oplog.rs
replset.election
replset.minvalid
replset.oplogTruncateAfterPoint
startup_log
system.profile
system.replset
system.rollback.id
pricing:PRIMARY> db.getReplicationInfo()
{
        "logSizeMB" : 40960,
        "usedMB" : 40942.02,
        "timeDiff" : 36757,
        "timeDiffHours" : 10.21,
        "tFirst" : "Wed Nov 02 2022 04:22:03 GMT+0800 (CST)",
        "tLast" : "Wed Nov 02 2022 14:34:40 GMT+0800 (CST)",
        "now" : "Wed Nov 02 2022 14:34:40 GMT+0800 (CST)"
}
pricing:PRIMARY>
pricing:PRIMARY> 
pricing:PRIMARY> rs.printReplicationInfo()
configured oplog size:   40960MB
log length start to end: 36791secs (10.22hrs)
oplog first event time:  Wed Nov 02 2022 04:22:03 GMT+0800 (CST)
oplog last event time:   Wed Nov 02 2022 14:35:14 GMT+0800 (CST)
now:                     Wed Nov 02 2022 14:35:14 GMT+0800 (CST)
pricing:PRIMARY> 
pricing:PRIMARY> db.oplog.rs.stats()
{
        "ns" : "local.oplog.rs",
        "size" : 42540148816,
        "count" : 51569568,
        "avgObjSize" : 824,
        "storageSize" : 7950401536,
        "capped" : true,
        "max" : -1,
        "maxSize" : NumberLong("42949672960"),
        "sleepCount" : 0,
        "sleepMS" : 0,
        "wiredTiger" : {
                "metadata" : {
                        "formatVersion" : 1,
                        "oplogKeyExtractionVersion" : 1
                },
                "creationString" : "access_pattern_hint=none,allocation_size=4KB,app_metadata=(formatVersion=1,oplogKeyExtractionVersion=1),assert=(commit_timestamp=none,durable_timestamp=none,read_timestamp=none),block_allocation=best,block_compressor=zlib,cache_resident=false,checksum=on,colgroups=,collator=,columns=,dictionary=0,encryption=(keyid=,name=),exclusive=false,extractor=,format=btree,huffman_key=,huffman_value=,ignore_in_memory_cache_size=false,immutable=false,internal_item_max=0,internal_key_max=0,internal_key_truncate=true,internal_page_max=4KB,key_format=q,key_gap=10,leaf_item_max=0,leaf_key_max=0,leaf_page_max=32KB,leaf_value_max=64MB,log=(enabled=true),lsm=(auto_throttle=true,bloom=true,bloom_bit_count=16,bloom_config=,bloom_hash_count=8,bloom_oldest=false,chunk_count_limit=0,chunk_max=5GB,chunk_size=10MB,merge_custom=(prefix=,start_generation=0,suffix=),merge_max=15,merge_min=0),memory_page_image_max=0,memory_page_max=10m,os_cache_dirty_max=0,os_cache_max=0,prefix_compression=false,prefix_compression_min=4,source=,split_deepen_min_child=0,split_deepen_per_child=0,split_pct=90,type=file,value_format=u",
                "type" : "file",
                "uri" : "statistics:table:local/collection-10-161348884478813828",
                "LSM" : {
                        "bloom filter false positives" : 0,
                        "bloom filter hits" : 0,
                        "bloom filter misses" : 0,
                        "bloom filter pages evicted from cache" : 0,
                        "bloom filter pages read into cache" : 0,
                        "bloom filters in the LSM tree" : 0,
                        "chunks in the LSM tree" : 0,
                        "highest merge generation in the LSM tree" : 0,
                        "queries that could have benefited from a Bloom filter that did not exist" : 0,
                        "sleep for LSM checkpoint throttle" : 0,
                        "sleep for LSM merge throttle" : 0,
                        "total size of bloom filters" : 0
                },
                "block-manager" : {
                        "allocations requiring file extension" : 3349112,
                        "blocks allocated" : 1352362833,
                        "blocks freed" : 1345571669,
                        "checkpoint size" : 7835570176,
                        "file allocation unit size" : 4096,
                        "file bytes available for reuse" : 114409472,
                        "file magic number" : 120897,
                        "file major version number" : 1,
                        "file size in bytes" : 7950401536,
                        "minor version number" : 0
                },
                "btree" : {
                        "btree checkpoint generation" : 928091,
                        "column-store fixed-size leaf pages" : 0,
                        "column-store internal pages" : 0,
                        "column-store variable-size RLE encoded values" : 0,
                        "column-store variable-size deleted values" : 0,
                        "column-store variable-size leaf pages" : 0,
                        "fixed-record size" : 0,
                        "maximum internal page key size" : 368,
                        "maximum internal page size" : 4096,
                        "maximum leaf page key size" : 2867,
                        "maximum leaf page size" : 32768,
                        "maximum leaf page value size" : 67108864,
                        "maximum tree depth" : 5,
                        "number of key/value pairs" : 0,
                        "overflow pages" : 0,
                        "pages rewritten by compaction" : 0,
                        "row-store empty values" : 0,
                        "row-store internal pages" : 0,
                        "row-store leaf pages" : 0
                },
                "cache" : {
                        "bytes currently in the cache" : 39097477,
                        "bytes dirty in the cache cumulative" : NumberLong("3227120864196337"),
                        "bytes read into cache" : NumberLong("30649434970826"),
                        "bytes written from cache" : NumberLong("224393078444959"),
                        "checkpoint blocked page eviction" : 27826976,
                        "data source pages selected for eviction unable to be evicted" : 147137511,
                        "eviction walk passes of a file" : 125609432,
                        "eviction walk target pages histogram - 0-9" : 42799981,
                        "eviction walk target pages histogram - 10-31" : 56133966,
                        "eviction walk target pages histogram - 128 and higher" : 0,
                        "eviction walk target pages histogram - 32-63" : 8075032,
                        "eviction walk target pages histogram - 64-128" : 18600453,
                        "eviction walks abandoned" : 15063773,
                        "eviction walks gave up because they restarted their walk twice" : 18693145,
                        "eviction walks gave up because they saw too many pages and found no candidates" : 16532444,
                        "eviction walks gave up because they saw too many pages and found too few candidates" : 1782330,
                        "eviction walks reached end of tree" : 77160479,
                        "eviction walks started from root of tree" : 53810662,
                        "eviction walks started from saved location in tree" : 71798770,
                        "hazard pointer blocked page eviction" : 101789687,
                        "in-memory page passed criteria to be split" : 143730001,
                        "in-memory page splits" : 27435891,
                        "internal pages evicted" : 24318895,
                        "internal pages split during eviction" : 117395,
                        "leaf pages split during eviction" : 29879780,
                        "modified pages evicted" : 1756301835,
                        "overflow pages read into cache" : 0,
                        "page split during eviction deepened the tree" : 2,
                        "page written requiring cache overflow records" : 6411919,
                        "pages read into cache" : 37786688,
                        "pages read into cache after truncate" : 6,
                        "pages read into cache after truncate in prepare state" : 0,
                        "pages read into cache requiring cache overflow entries" : 4430210,
                        "pages requested from the cache" : 852708978123,
                        "pages seen by eviction walk" : 13053020461,
                        "pages written from cache" : 1350505636,
                        "pages written requiring in-memory restoration" : 1643469608,
                        "tracked dirty bytes in the cache" : 16868908,
                        "unmodified pages evicted" : 520958986
                },
                "cache_walk" : {
                        "Average difference between current eviction generation when the page was last considered" : 0,
                        "Average on-disk page image size seen" : 0,
                        "Average time in cache for pages that have been visited by the eviction server" : 0,
                        "Average time in cache for pages that have not been visited by the eviction server" : 0,
                        "Clean pages currently in cache" : 0,
                        "Current eviction generation" : 0,
                        "Dirty pages currently in cache" : 0,
                        "Entries in the root page" : 0,
                        "Internal pages currently in cache" : 0,
                        "Leaf pages currently in cache" : 0,
                        "Maximum difference between current eviction generation when the page was last considered" : 0,
                        "Maximum page size seen" : 0,
                        "Minimum on-disk page image size seen" : 0,
                        "Number of pages never visited by eviction server" : 0,
                        "On-disk page image sizes smaller than a single allocation unit" : 0,
                        "Pages created in memory and never written" : 0,
                        "Pages currently queued for eviction" : 0,
                        "Pages that could not be queued for eviction" : 0,
                        "Refs skipped during cache traversal" : 0,
                        "Size of the root page" : 0,
                        "Total number of pages currently in cache" : 0
                },
                "compression" : {
                        "compressed page maximum internal page size prior to compression" : 4096,
                        "compressed page maximum leaf page size prior to compression " : 131072,
                        "compressed pages read" : 19334567,
                        "compressed pages written" : 1292203047,
                        "page written failed to compress" : 15,
                        "page written was too small to compress" : 58284301
                },
                "cursor" : {
                        "bulk loaded cursor insert calls" : 0,
                        "cache cursors reuse count" : 161218247576,
                        "close calls that result in cache" : 0,
                        "create calls" : 8540658,
                        "insert calls" : 93786543065,
                        "insert key and value bytes" : NumberLong("217477902319400"),
                        "modify" : 0,
                        "modify key and value bytes affected" : 0,
                        "modify value bytes modified" : 0,
                        "next calls" : 383465738645,
                        "open cursor count" : 0,
                        "operation restarted" : 125673801,
                        "prev calls" : 2424332,
                        "remove calls" : 0,
                        "remove key bytes removed" : 0,
                        "reserve calls" : 0,
                        "reset calls" : 453145034066,
                        "search calls" : 201387099129,
                        "search near calls" : 48617868,
                        "truncate calls" : 606206,
                        "update calls" : 0,
                        "update key and value bytes" : 0,
                        "update value size change" : 0
                },
                "reconciliation" : {
                        "dictionary matches" : 0,
                        "fast-path pages deleted" : 1305741465,
                        "internal page key bytes discarded using suffix compression" : 2510526175,
                        "internal page multi-block writes" : 2247001,
                        "internal-page overflow keys" : 0,
                        "leaf page key bytes discarded using prefix compression" : 0,
                        "leaf page multi-block writes" : 30862966,
                        "leaf-page overflow keys" : 0,
                        "maximum blocks required for a page" : 248,
                        "overflow values written" : 0,
                        "page checksum matches" : 62730811,
                        "page reconciliation calls" : 1826026066,
                        "page reconciliation calls for eviction" : 1744888010,
                        "pages deleted" : 50258568
                },
                "session" : {
                        "object compaction" : 0
                },
                "transaction" : {
                        "update conflicts" : 0
                }
        },
        "nindexes" : 0,
        "indexBuilds" : [ ],
        "totalIndexSize" : 0,
        "indexSizes" : {

        },
        "scaleFactor" : 1,
        "ok" : 1
}
pricing:PRIMARY> db.oplog.rs.stats().size
42639175559
pricing:PRIMARY> 
pricing:PRIMARY> 
pricing:PRIMARY> db.oplog.rs.stats().maxSize
NumberLong("42949672960")
pricing:PRIMARY> 

正式执行在线修改oplog命令

pricing:PRIMARY> db.adminCommand({replSetResizeOplog:1,size:200000})
{ "ok" : 1 }
pricing:PRIMARY> db.getReplicationInfo()
{
        "logSizeMB" : 200000,
        "usedMB" : 40762.12,
        "timeDiff" : 36973,
        "timeDiffHours" : 10.27,
        "tFirst" : "Wed Nov 02 2022 04:35:56 GMT+0800 (CST)",
        "tLast" : "Wed Nov 02 2022 14:52:09 GMT+0800 (CST)",
        "now" : "Wed Nov 02 2022 14:52:09 GMT+0800 (CST)"
}
pricing:PRIMARY> 
pricing:PRIMARY> rs.printReplicationInfo()
configured oplog size:   200000MB
log length start to end: 37013secs (10.28hrs)
oplog first event time:  Wed Nov 02 2022 04:35:56 GMT+0800 (CST)
oplog last event time:   Wed Nov 02 2022 14:52:49 GMT+0800 (CST)
now:                     Wed Nov 02 2022 14:52:49 GMT+0800 (CST)
pricing:PRIMARY> 
pricing:PRIMARY> db.oplog.rs.stats()
{
        "ns" : "local.oplog.rs",
        "size" : 42797529322,
        "count" : 51864026,
        "avgObjSize" : 825,
        "storageSize" : 7950401536,
        "capped" : true,
        "max" : -1,
        "maxSize" : NumberLong("209715200000"),
        "sleepCount" : 0,
        "sleepMS" : 0,
        "wiredTiger" : {
                "metadata" : {
                        "formatVersion" : 1,
                        "oplogKeyExtractionVersion" : 1
                },
                "creationString" : "access_pattern_hint=none,allocation_size=4KB,app_metadata=(formatVersion=1,oplogKeyExtractionVersion=1),assert=(commit_timestamp=none,durable_timestamp=none,read_timestamp=none),block_allocation=best,block_compressor=zlib,cache_resident=false,checksum=on,colgroups=,collator=,columns=,dictionary=0,encryption=(keyid=,name=),exclusive=false,extractor=,format=btree,huffman_key=,huffman_value=,ignore_in_memory_cache_size=false,immutable=false,internal_item_max=0,internal_key_max=0,internal_key_truncate=true,internal_page_max=4KB,key_format=q,key_gap=10,leaf_item_max=0,leaf_key_max=0,leaf_page_max=32KB,leaf_value_max=64MB,log=(enabled=true),lsm=(auto_throttle=true,bloom=true,bloom_bit_count=16,bloom_config=,bloom_hash_count=8,bloom_oldest=false,chunk_count_limit=0,chunk_max=5GB,chunk_size=10MB,merge_custom=(prefix=,start_generation=0,suffix=),merge_max=15,merge_min=0),memory_page_image_max=0,memory_page_max=10m,os_cache_dirty_max=0,os_cache_max=0,prefix_compression=false,prefix_compression_min=4,source=,split_deepen_min_child=0,split_deepen_per_child=0,split_pct=90,type=file,value_format=u",
                "type" : "file",
                "uri" : "statistics:table:local/collection-10-161348884478813828",
                "LSM" : {
                        "bloom filter false positives" : 0,
                        "bloom filter hits" : 0,
                        "bloom filter misses" : 0,
                        "bloom filter pages evicted from cache" : 0,
                        "bloom filter pages read into cache" : 0,
                        "bloom filters in the LSM tree" : 0,
                        "chunks in the LSM tree" : 0,
                        "highest merge generation in the LSM tree" : 0,
                        "queries that could have benefited from a Bloom filter that did not exist" : 0,
                        "sleep for LSM checkpoint throttle" : 0,
                        "sleep for LSM merge throttle" : 0,
                        "total size of bloom filters" : 0
                },
                "block-manager" : {
                        "allocations requiring file extension" : 3349112,
                        "blocks allocated" : 1352369190,
                        "blocks freed" : 1345575514,
                        "checkpoint size" : 7871774720,
                        "file allocation unit size" : 4096,
                        "file bytes available for reuse" : 77344768,
                        "file magic number" : 120897,
                        "file major version number" : 1,
                        "file size in bytes" : 7950401536,
                        "minor version number" : 0
                },
                "btree" : {
                        "btree checkpoint generation" : 928106,
                        "column-store fixed-size leaf pages" : 0,
                        "column-store internal pages" : 0,
                        "column-store variable-size RLE encoded values" : 0,
                        "column-store variable-size deleted values" : 0,
                        "column-store variable-size leaf pages" : 0,
                        "fixed-record size" : 0,
                        "maximum internal page key size" : 368,
                        "maximum internal page size" : 4096,
                        "maximum leaf page key size" : 2867,
                        "maximum leaf page size" : 32768,
                        "maximum leaf page value size" : 67108864,
                        "maximum tree depth" : 5,
                        "number of key/value pairs" : 0,
                        "overflow pages" : 0,
                        "pages rewritten by compaction" : 0,
                        "row-store empty values" : 0,
                        "row-store internal pages" : 0,
                        "row-store leaf pages" : 0
                },
                "cache" : {
                        "bytes currently in the cache" : 32983398,
                        "bytes dirty in the cache cumulative" : NumberLong("3227121205452138"),
                        "bytes read into cache" : NumberLong("30649436494315"),
                        "bytes written from cache" : NumberLong("224393784183736"),
                        "checkpoint blocked page eviction" : 27826976,
                        "data source pages selected for eviction unable to be evicted" : 147138809,
                        "eviction walk passes of a file" : 125612403,
                        "eviction walk target pages histogram - 0-9" : 42802670,
                        "eviction walk target pages histogram - 10-31" : 56134248,
                        "eviction walk target pages histogram - 128 and higher" : 0,
                        "eviction walk target pages histogram - 32-63" : 8075032,
                        "eviction walk target pages histogram - 64-128" : 18600453,
                        "eviction walks abandoned" : 15063805,
                        "eviction walks gave up because they restarted their walk twice" : 18695809,
                        "eviction walks gave up because they saw too many pages and found no candidates" : 16532476,
                        "eviction walks gave up because they saw too many pages and found too few candidates" : 1782334,
                        "eviction walks reached end of tree" : 77165926,
                        "eviction walks started from root of tree" : 53813399,
                        "eviction walks started from saved location in tree" : 71799004,
                        "hazard pointer blocked page eviction" : 101789981,
                        "in-memory page passed criteria to be split" : 143730168,
                        "in-memory page splits" : 27435974,
                        "internal pages evicted" : 24319050,
                        "internal pages split during eviction" : 117396,
                        "leaf pages split during eviction" : 29879875,
                        "modified pages evicted" : 1756302206,
                        "overflow pages read into cache" : 0,
                        "page split during eviction deepened the tree" : 2,
                        "page written requiring cache overflow records" : 6411919,
                        "pages read into cache" : 37786766,
                        "pages read into cache after truncate" : 6,
                        "pages read into cache after truncate in prepare state" : 0,
                        "pages read into cache requiring cache overflow entries" : 4430210,
                        "pages requested from the cache" : 852715516011,
                        "pages seen by eviction walk" : 13053049871,
                        "pages written from cache" : 1350511963,
                        "pages written requiring in-memory restoration" : 1643469619,
                        "tracked dirty bytes in the cache" : 10754938,
                        "unmodified pages evicted" : 520960849
                },
                "cache_walk" : {
                        "Average difference between current eviction generation when the page was last considered" : 0,
                        "Average on-disk page image size seen" : 0,
                        "Average time in cache for pages that have been visited by the eviction server" : 0,
                        "Average time in cache for pages that have not been visited by the eviction server" : 0,
                        "Clean pages currently in cache" : 0,
                        "Current eviction generation" : 0,
                        "Dirty pages currently in cache" : 0,
                        "Entries in the root page" : 0,
                        "Internal pages currently in cache" : 0,
                        "Leaf pages currently in cache" : 0,
                        "Maximum difference between current eviction generation when the page was last considered" : 0,
                        "Maximum page size seen" : 0,
                        "Minimum on-disk page image size seen" : 0,
                        "Number of pages never visited by eviction server" : 0,
                        "On-disk page image sizes smaller than a single allocation unit" : 0,
                        "Pages created in memory and never written" : 0,
                        "Pages currently queued for eviction" : 0,
                        "Pages that could not be queued for eviction" : 0,
                        "Refs skipped during cache traversal" : 0,
                        "Size of the root page" : 0,
                        "Total number of pages currently in cache" : 0
                },
                "compression" : {
                        "compressed page maximum internal page size prior to compression" : 4096,
                        "compressed page maximum leaf page size prior to compression " : 131072,
                        "compressed pages read" : 19334588,
                        "compressed pages written" : 1292209163,
                        "page written failed to compress" : 15,
                        "page written was too small to compress" : 58284512
                },
                "cursor" : {
                        "bulk loaded cursor insert calls" : 0,
                        "cache cursors reuse count" : 161219534286,
                        "close calls that result in cache" : 0,
                        "create calls" : 8540692,
                        "insert calls" : 93787274704,
                        "insert key and value bytes" : NumberLong("217478595773904"),
                        "modify" : 0,
                        "modify key and value bytes affected" : 0,
                        "modify value bytes modified" : 0,
                        "next calls" : 383467917404,
                        "open cursor count" : 0,
                        "operation restarted" : 125674078,
                        "prev calls" : 2424372,
                        "remove calls" : 0,
                        "remove key bytes removed" : 0,
                        "reserve calls" : 0,
                        "reset calls" : 453148494366,
                        "search calls" : 201388546170,
                        "search near calls" : 48617880,
                        "truncate calls" : 606207,
                        "update calls" : 0,
                        "update key and value bytes" : 0,
                        "update value size change" : 0
                },
                "reconciliation" : {
                        "dictionary matches" : 0,
                        "fast-path pages deleted" : 1305745172,
                        "internal page key bytes discarded using suffix compression" : 2510539166,
                        "internal page multi-block writes" : 2247031,
                        "internal-page overflow keys" : 0,
                        "leaf page key bytes discarded using prefix compression" : 0,
                        "leaf page multi-block writes" : 30863075,
                        "leaf-page overflow keys" : 0,
                        "maximum blocks required for a page" : 248,
                        "overflow values written" : 0,
                        "page checksum matches" : 62731972,
                        "page reconciliation calls" : 1826026650,
                        "page reconciliation calls for eviction" : 1744888215,
                        "pages deleted" : 50258759
                },
                "session" : {
                        "object compaction" : 0
                },
                "transaction" : {
                        "update conflicts" : 0
                }
        },
        "nindexes" : 0,
        "indexBuilds" : [ ],
        "totalIndexSize" : 0,
        "indexSizes" : {

        },
        "scaleFactor" : 1,
        "ok" : 1
}
pricing:PRIMARY> 
pricing:PRIMARY> db.oplog.rs.stats().size
42800956946
pricing:PRIMARY> 
pricing:PRIMARY> db.oplog.rs.stats().maxSize
NumberLong("209715200000")
pricing:PRIMARY> exit
bye

标签:--,Mongodb,cache,page,eviction,oplog,pages,size
From: https://www.cnblogs.com/hsjz-xinyuan/p/16851882.html

相关文章

  • 静态POD
    前言:虽然学习了一段时间的k8s的各种资源,但是静态POD一直停留在概念层面,不知道它有什么用。静态POD下面是摘录自《kubernetes权威指南》上关于静态POD的描述信息。定义:静......
  • nginx配置http服务简单入门
    nginx是用的最多的web服务器java和python可以写nginx服务,为什么还需要nginx是因为nginx是纯粹的做http实现的服务,并没有业务逻辑,做http代理1.需要安装nginxnginx.org主......
  • 比while not FDQuery.eof do更高效率的读取数据
    forI:=0toFDMemTable1.Table.Rows.Count-1dobeginMemo1.Lines.Add(VarToStrdef(FDMemTable1.Table.Rows[i].ValueI[1],''));end;这个不会触发AfterSc......
  • 无线VLAN之AP 桥
    STA要获取到IP,就要配置相应的业务VLAN。AP LAN侧---->无线业务,例如ath0,ath1         ----->有线业务,例eth0.200;eth0.300AP从eth0口接收到包,然后根......
  • next()&nextline()的应用-2022-11-2
    next()的应用packagescanner;importjava.util.Scanner;publicclassDemo01{publicstaticvoidmain(String[]args){//创建一个扫描器对象Scann......
  • 输入整数或者小数-2022-11-2
    packagescanner;importjava.util.Scanner;publicclassDemo03{publicstaticvoidmain(String[]args){Scannerscanner=newScanner(System.in);......
  • Java-抽象模板模式
    什么是模板模式?定义程序的骨架,而将一些步骤延迟到子类中。模板模式使得子类可以不需要改变程序的结构即可重定义该程序的某些特定步骤。通俗的讲,模......
  • 第九章 异常处理及程序调试
    一、模拟幼儿园分苹果defdivision():'''功能:分苹果'''print("\n======================分苹果了===================")apple=int(input("请输入苹果......
  • 海外新规丨苹果正式允许NFT应用上架iOS 分成30%
     2022年10月26日16:18天津扬帆出海官方账号10月24日,苹果对其海外版AppStore审核指南进行了更新,并首次正式为提供iOS应用程序制定了NFT相关规则。 根据其更新后的审......
  • 抓包
    目录抓微信小程序查尔斯抓微信小程序查尔斯实测可以抓个域名,内容为乱码https://blog.csdn.net/lw1558533893/article/details/125485596?spm=1001.2101.3001.6650.15&......