MongoDB爱好者
垂直技术交流平台

serverStatus详解

定义
行为
输出

定义

==serverStatus
serverStatus命令返回一个文档,该文档提供数据库状态的概述。监控应用程序可以定期运行此命令收集有关该实例的统计信息。
db.runCommand( { serverStatus: 1 } )

值(即1)不会影响命令的操作。同时mongo shell提供了db.serverStatus()封装该命令。
注:
serverStatus的大部分输出也动态显示在mongostat命令中。可参阅 mongostat命令。

行为

默认情况下,serverStatus在其输出中排除repl文档中的一些内容。
要输出默认排除的字段,需要明确定义顶级字段,在命令中设置顶级字段为1。要排除默认包含的字段,在命令中设置顶级字段为0。
例如,在输出中排除repl, metrics, locks信息。
db.runCommand( { serverStatus: 1, repl: 0, metrics: 0, locks: 0 } )
在输出中包含所有repl信息:
db.runCommand( { serverStatus: 1, repl: 1 } )

输出

注意
输出字段取决于:MongoDB的版本,底层的操作系统平台,存储引擎,和节点类型(包括mongos,mongod或 副本集成员)。
serverStatus在不同MongoDB版本的输出字段,请参阅相应版本的MongoDB手册。
从MongoDB 4.0.6开始,serverStatus包括:
opReadConcernCounters
opWriteConcernCounters(需要reportOpWriteConcernCountersInServerStatus参数设置为true)。
metrics.repl.apply.batchSize
从MongoDB 4.0开始,serverStatus输出中包含 shardingStatistics。
从MongoDB 3.6开始,serverStatus不再输出 rangeDeleter部分。
在MongoDB中3.0开始,serverStatus不再输出 workingSet,indexCounters以及recordStats部分。

实例信息:

"host" : ,
"advisoryHostFQDNs" : ,
"version" : ,
"process" : ,
"pid" : ,
"uptime" : ,
"uptimeMillis" : ,
"uptimeEstimate" : ,
"localTime" : ISODate(“"),

host: 系统的主机名。在Unix / Linux系统中,与hostname命令的输出相同。
advisoryHostFQDNs: 3.2版本新功能,全限定域名数组
version:当前MongoDB进程的MongoDB版本。
process:当前的MongoDB进程,可能的值为mongos或mongod
pid: 进程的id号
uptime: 当前MongoDB进程处于活动状态的总秒数,即启动时长。
uptimeMillis: 当前MongoDB进程处于活动状态的毫秒数。
uptimeEstimate: MongoDB内部粗粒度时间保持系统以秒为单位的启动时长
localTime: ISODate表示服务器当前时间,以UTC表示。

asserts

"asserts" : {
 "regular" : ,
   "warning" : ,
   "msg" : ,
   "user" : ,
"rollovers" : 
},

asserts: 报告自MongoDB进程启动以来引发的断言数目的文档。虽然断言错误一般不常见,但如果asserts非零,则应检查日志文件以获取更多信息。在许多情况下,这些错误是微不足道的,但值得研究。
asserts.regular: 自MongoDB进程启动以来引发的常规断言数。检查日志文件以获取有关这些消息的更多信息。
asserts.warning: 在4.0版中更改, 从MongoDB 4.0开始,该字段返回零0。在早期版本中,该字段返回自MongoDB进程启动以来引发的警告数。
asserts.msg: 自MongoDB进程启动以来引发的消息断言数。检查日志文件以获取更多信息。
asserts.user: 自上次MongoDB进程启动以来发生的“用户断言”数。这些是用户可能生成的错误,例如磁盘空间不足或重复密钥。您可以通过修复应用程序或部署问题来阻止这些断言。查看MongoDB日志以获取更多信息。
asserts.rollovers:自上次MongoDB进程启动以来翻转计数器已翻转的次数。在2^30个断言之后,计数器将翻转为零。使用此值可为asserts数据结构中的其他值提供上下文 。

backgroundFlushing

"backgroundFlushing" : {
   "flushes" : ,
   "total_ms" : ,
   "average_ms" : ,
   "last_ms" : ,
   "last_finished" : ISODate("...")
},

注意
backgroundFlushing仅对使用MMAPv1存储引擎的实例显示。

backgroundFlushing:报告mongod进程定期写入磁盘的文档。如果关心对写入性能和journaling,请参考这些值。
backgroundFlushing.flushes: 数据库将所有写入刷盘的次数。当数据库运行较长时间时,此值将增加。
backgroundFlushing.total_ms: mongod 进程将数据写入(即刷新)到磁盘所花费的总毫秒数(ms)。因为total_ms是绝对值,需综合考虑flushes和 average_ms值。
backgroundFlushing.average_ms: 以毫秒为单位每次刷盘的平均时间,通过total_ms/flushes计算得出。average_ms更可能代表 flushes增加值。不过,异常数据可能会扭曲此值。使用 backgroundFlushing.last_ms以检查高平均值是否因瞬态历史事件或随机写入分布而发生偏差。
backgroundFlushing.last_ms: 上次刷新操作完成所花费的时间(以毫秒为单位)。使用此值可验证服务器的当前性能是否与backgroundFlushing.average_ms和 backgroundFlushing.total_ms提供的历史数据一致。
backgroundFlushing.last_finished: 上次刷新操作完成的 时间戳,以ISODate格式表示。如果此值超过服务器当前时间几分钟并且考虑到时区差异,则重启数据库可能会导致一些数据丢失。也可以考虑通过常规阻止写入操作来阻止此值的持续操作。

connections

"connections" : {
   "current" : ,
   "available" : ,
   "totalCreated" : NumberLong()
},

connections: 报告连接状态的文档。使用这些值来评估服务器的当前负载和容量要求。
connections.current: 从客户端到数据库服务器的连接数。此数值包括当前的shell会话。考虑connections.available为此数据添加更多上下文的值。
该值将包括所有传入连接,包括任何shell连接或来自其他服务器的连接,例如 副本集成员或mongos实例。
connections.available: 可用的未使用连接数。将此值与 connections.current以了解数据库上的连接负载,查阅UNIX ulimit设置文档,获取有关可用连接的系统阈值的更多信息。
connections.totalCreated: 计算创建到服务器的所有连接。此数字包括已关闭的连接。

dur (journaling)

"dur" : {
   "commits" : ,
   "journaledMB" : ,
   "writeToDataFilesMB" : ,
   "compression" : ,
   "commitsInWriteLock" : ,
   "earlyCommits" : ,
   "timeMs" : {
      "dt" : ,
      "prepLogBuffer" : ,
      "writeToJournal" : ,
      "writeToDataFiles" : ,
      "remapPrivateView" : ,
      "commits" : ,
      "commitsInWriteLock" : 
   }
},

注意
dur(journaling)信息仅出现在 mongod实例,并且使用MMAPv1存储引擎且启用了journaling。

dur: 报告mongod实例 与日志相关的操作和性能的文档。MongoDB每3秒报告此数据,收集过去3到6秒之间的信息。
dur.commits:在上一个日志组提交间隔期间写入日志的事务数。
dur.journaledMB: 在上一个日志组提交间隔期间写入日志的数据量(单位(MB))。
dur.writeToDataFilesMB: 在上一个日志组提交间隔期间从日志写入数据文件的数据量(MB)。
dur.compression: 写入日志的数据的压缩率:
( journaled_size_of_data / uncompressed_size_of_data )
dur.commitsInWriteLock: 持有写锁时发生的提交计数。写锁的提交数表示MongoDB节点处于高写负载下,并要求进一步诊断。
dur.earlyCommits: MongoDB在计划的日志组提交间隔之前请求提交的次数 。使用此值确保日记组提交间隔部署时间不会太长。
dur.timeMS: mongod 实例在上一个日记组提交间隔的journaling的各个阶段中报告实例性能的文档。
dur.timeMS.dt: MongoDB收集dur.timeMS数据(以毫秒为单位)。使用此字段为其他dur.timeMS字段值提供上下文。
dur.timeMS.prepLogBuffer: 准备写入日志所花费的时间(以毫秒为单位)。值越小则日志性能越好。
dur.timeMS.writeToJournal: 实际写入日志所花费的时间(以毫秒为单位)。文件系统速度和设备接口会影响其性能。
dur.timeMS.writeToDataFiles: 在日志之后写入数据文件所花费的时间(以毫秒为单位)。文件系统速度和设备接口会影响其性能。
dur.timeMS.remapPrivateView: 重新映射copy-on-write内存映射视图所花费的时间(以毫秒为单位)。较小的值表明日志性能越好。
dur.timeMS.commits: 提交所花费的时间(以毫秒为单位)。
dur.timeMS.commitsInWriteLock: 持有写锁时,提交所花费的时间(以毫秒为单位)

extra_info

"extra_info" : {
   "note" : "fields vary by platform.",
   "heap_usage_bytes" : ,
   "page_faults" : 
},

extra_info: 提供有关基础系统的其他信息的文档。
extra_info.note: 字符串文本 “fields vary by platform.”
extra_info.heap_usage_bytes: 数据库进程使用的堆空间的总大小(以字节为单位)。仅适用于Unix / Linux系统。
extra_info.page_faults: 缺页中断总数。当性能瓶颈或者内存不足或者数据集增大, extra_info.page_faults计数器动态的增加。有限和零星的缺页中断不一定表示问题。
Windows区分“硬”缺页中断包括硬盘I/O,“软”缺页中断仅需要内存页面移动。MongoDB在此统计信息中计算硬缺页中断和软缺页中断。
freeMonitoring

"freeMonitoring" : {
   "state" : ,
   "retryIntervalSecs" : ,
   "lastRunTime" : ,
   "registerErrors" : ,
   "metricsErrors" : 
},

freeMonitoring:报告免费云监控的文档。
freeMonitoring.state:免费监控的启用状态。值可以是:“enabled”,“disabled”,”pending”如果启用免费监控, 遇到注册错误。
freeMonitoring.retryIntervalSecs: 上传数据的频率(以秒为单位)。
freeMonitoring.lastRunTime: 上次运行指标的日期和时间。
freeMonitoring.registerErrors: 注册错误的数量,遇到非期望的HTTP状态或网络错误时会增加。
freeMonitoring.metricsErrors: 上传指标时遇到的错误数。

globalLock

"globalLock" : {
   "totalTime" : ,
   "currentQueue" : {
      "total" : ,
      "readers" : ,
      "writers" : 
   },
   "activeClients" : {
      "total" : ,
      "readers" : ,
      "writers" : 
   }
},

globalLock: 报告数据库锁状态的文档。通常,锁文档提供有关锁使用的更详细数据。
globalLock.totalTime: 自数据库上次启动和创建全局锁以来的时间(以微秒为单位)。这大致与总服务器启动时间相同。
globalLock.currentQueue: 锁引起的排队操作数目的文档
globalLock.currentQueue.total: 等锁的操作的总数(即,总和globalLock.currentQueue.readers和 globalLock.currentQueue.writers)。
持续很小的队列,特别是较短的操作,不必关注。综合考虑globalLock.activeClients 读写相关信息。
globalLock.currentQueue.readers: 排队等待读锁的操作数。持续很小的读队列,尤其是较短的操作,不必关注。
globalLock.currentQueue.writers: 排队等待写锁的操作数。持续很小写队列,特别是较短的操作,不必关注。
globalLock.activeClients: 正在执行读写操作的已连接客户端数目文档,综合考虑 globalLock.currentQueue。
globalLock.activeClients.total: 内部客户端连接db总数,包括系统线程以及读写队列。由于包括系统线程,此值将高于activeClients.readers 和activeClients.writers之和。
globalLock.activeClients.readers: 执行读操作的活跃客户端连接数。
globalLock.activeClients.writers: 执行写操作的活跃客户端连接数。

logicalSessionRecordCache
3.6 版本的新功能。

"logicalSessionRecordCache" : {
   "activeSessionsCount" : ,
   "sessionsCollectionJobCount" : ,
   "lastSessionsCollectionJobDurationMillis" : ,
   "lastSessionsCollectionJobTimestamp" : ,
   "lastSessionsCollectionJobEntriesRefreshed" : ,
   "lastSessionsCollectionJobEntriesEnded" : ,
   "lastSessionsCollectionJobCursorsClosed" : ,
   "transactionReaperJobCount" : ,
   "lastTransactionReaperJobDurationMillis" : ,
   "lastTransactionReaperJobTimestamp" : ,
   "lastTransactionReaperJobEntriesCleanedUp" : 
},

logicalSessionRecordCache.activeSessionsCount: 自上次刷新周期以来mongod或mongos实例在内存中缓存的所有活跃本地会话的数目 。
参阅:
$listLocalSessions
logicalSessionRefreshMillis
logicalSessionRefreshMinutes
logicalSessionRecordCache.sessionsCollectionJobCount: 跟踪刷新进程在config.system.sessions集合上运行的次数的数目。
参阅:logicalSessionRefreshMinutes
logicalSessionRecordCache.lastSessionsCollectionJobDurationMillis: 上次刷新的长度(以毫秒为单位)。
logicalSessionRecordCache.lastSessionsCollectionJobTimestamp: 上次刷新的时间。
logicalSessionRecordCache.lastSessionsCollectionJobEntriesRefreshed: 上次刷新期间刷新的会话数。
logicalSessionRecordCache.lastSessionsCollectionJobEntriesEnded:上次刷新期间结束的会话数。
logicalSessionRecordCache.lastSessionsCollectionJobCursorsClosed:上次config.system.sessions集合刷新期间关闭的游标数 。
logicalSessionRecordCache.transactionReaperJobCount
跟踪事务记录清理进程在config.transactions 集合上运行的次数的数目。
logicalSessionRecordCache.lastTransactionReaperJobDurationMillis:上次事务记录清理的长度(以毫秒为单位)。
logicalSessionRecordCache.lastTransactionReaperJobTimestamp:最后一次事务记录清理的时间。
logicalSessionRecordCache.lastTransactionReaperJobEntriesCleanedUp:
在上次事务记录清理期间删除的config.transactions集合中的条目数。

locks

"locks" : {
    : {
         "acquireCount" : {
             : NumberLong(),
            ...
         },
         "acquireWaitCount" : {
             : NumberLong(),
            ...
         },
         "timeAcquiringMicros" : {
             : NumberLong(),
            ...
         },
         "deadlockCount" : {
             : NumberLong(),
            ...
         }
   },
   …

locks
在3.0版中更改。
报告每个锁和锁数据的文档。
锁如下:
Lock Type Description
Global Represents global lock.
MMAPV1Journal Represents MMAPv1 storage engine specific lock to synchronize journal writes; for non-MMAPv1 storage engines, the mode for MMAPV1Journal is empty.
Database Represents database lock.
Collection Represents collection lock.
Metadata Represents metadata lock.
oplog Represents lock on the oplog.
如下:
Lock Mode Description
R Represents Shared (S) lock.
W Represents Exclusive (X) lock.
r Represents Intent Shared (IS) lock.
w Represents Intent Exclusive (IX) lock.
所有值均为NumberLong()类型。

locks..acquireCount:在特定模式下获取锁的次数。
locks..acquireWaitCount: 因锁冲突,引起locks.acquireCount锁等待的次数。
locks..timeAcquiringMicros: 获取锁的等待时间和(以微秒为单位)。
locks.timeAcquiringMicros除以 locks.acquireWaitCount给出特定锁定模式的近似平均等待时间。
locks..deadlockCount: 获取锁时遇到死锁的次数。

network

"network" : {
   "bytesIn" : ,
   "bytesOut" : ,
   "numRequests" : 
},

network:报告MongoDB网络使用情况的文档。
network.bytesIn: 数据库接收的网络流量字节数。使用此值可确保发送到mongod进程的网络流量与预期和整个应用程序间流量一致。
network.bytesOut: 数据库发送的网络流量的字节数 。使用此值可确保mongod进程发送的网络流量与预期和整体应用程序间流量一致。
network.numRequests: 服务器已收到的不同请求的总数。使用此值为network.bytesIn和network.bytesOut 值提供上下文, 以确保MongoDB的网络使用率与期望和应用程序使用一致。

opLatencies
仅适用于mongod实例

"opLatencies" : {
   "reads" : ,
   "writes" : ,
   "commands" : 
},

opLatencies: 包含整个数据库操作延迟的文档。参阅latencyStats文档查看详细说明。只有mongod实例报告 opLatencies。
opLatencies.reads: 读请求的延迟统计信息。
opLatencies.writes: 写操作的延迟统计信息。
opLatencies.commands: 数据库命令的延迟统计信息。

opReadConcernCounters 

4.0.6版中的新功能,仅适用于mongod实例

"opReadConcernCounters" : {
   "available" : NumberLong(),
   "linearizable" : NumberLong(),
   "local" : NumberLong(),
   "majority" : NumberLong(),
   "snapshot" : NumberLong(),
   "none" :  NumberLong()
}

opReadConcernCounters
4.0.6版中的新功能。
报告自上次启动以来对mongod实例查询操作指定 的读取关注级别的文档。
Specified w Description
“available” Number of query operations that specified read concern level “available”.
“linearizable” Number of query operations that specified read concern level “linearizable”.
“local” Number of query operations that specified read concern level “local”.
“majority” Number of query operations that specified read concern level “majority”.
“snapshot” Number of query operations that specified read concern level “snapshot”.
“none” Number of query operations that did not specify a read concern level and instead used the default read concern level.

opReadConcernCounters之和等于 opcounters.query。

opWriteConcernCounters 

4.0.6版中的新功能,仅适用于mongod实例

"opWriteConcernCounters" : {
   "insert" : {
      "wmajority" : NumberLong(),
      "wnum" : {
         "" :  NumberLong(),
         ...
      },
      "wtag" : {
         "" :  NumberLong(),
         ...
      },
      "none" : NumberLong()
   },
   "update" : {
      "wmajority" : NumberLong(),
      "wnum" : {
         "" :  NumberLong(),
      },
      "wtag" : {
         "" :  NumberLong(),
         ...
      },
      "none" : NumberLong()
   },
   "delete" : {
      "wmajority" :  NumberLong()
      "wnum" : {
         "" :  NumberLong(),
         ...
      },
      "wtag" : {
         "" :  NumberLong(),
         ...
      },
      "none" : NumberLong()
   }
}

opWriteConcernCounters:报告自上次启动以来特定write concerns 下mongod实例的写入操作的文档。
更具体地说,opWriteConcernCounters 报告指定的w:的写入操作。日志标志选项(j)和write concerns的超时选项(wtimeout)不会影响计数。即使操作超时,计数也会增加。
注意:仅在reportOpWriteConcernCountersInServerStatus参数设置为true(false默认情况下)时可用 。

opWriteConcernCounters.insert

4.0.6版中的新功能。报告在特定的w:下,自上次启动以来对mongod实例执行的插入操作的文档:
注意:仅在reportOpWriteConcernCountersInServerStatus参数设置为true(false默认情况下)时可用 。

“insert”  : { 
   “wmajority”  : NumberLong ( ),
   “wnum”  : { 
      “”  :  NumberLong ( ),
      ... 
   },
   “wtag”  : { 
      “”  :  NumberLong ( ),
      ... 
   },
   “none”  : NumberLong ( )
},

opWriteConcernCounters.insert总和等于 opcounters.insert。

opWriteConcernCounters.update

4.0.6版中的新功能。报告在指定的w:下,自上次启动以来对实例的更新操作的文档:

注意:仅在reportOpWriteConcernCountersInServerStatus参数设置为true(false默认情况下)时可用 。

“update”  : { 
   “wmajority”  : NumberLong ( ),
   “wnum”  : { 
      “”  :  NumberLong ( ),
   },
   “wtag”  : { 
      “”  :  NumberLong ( ),
      ... 
   },
   “none”  : NumberLong ( )
},
Description

“wmajority” Number of insert operations that specified w: “majority”.
“wnum” Number of insert operations that specified w: . The counts are grouped by the specific .
“wtag” Number of insert operations that specified w: . The counts are grouped by the specific .
“none” Number of insert operations that did not specify w value. These operations use the default w value of 1.
opWriteConcernCounters.update总和等于opcounters.update。

opWriteConcernCounters.delete

4.0.6版中的新功能。报告指定的w:,自上次启动以来对mongod实例执行的删除操作的文档:
注意:仅在reportOpWriteConcernCountersInServerStatus参数设置为true(false默认情况下)时可用

"delete" : {
   "wmajority" :  NumberLong()
   "wnum" : {
      "" :  NumberLong(),
      ...
   },
   "wtag" : {
      "" :  NumberLong(),
      ...
   },
   "none" : NumberLong()
}
Description

“wmajority” Number of update operations that specified w: “majority”.
“wnum” Number of update operations that specified w: . The counts are grouped by the specific .
“wtag” Number of update operations that specified w: . The counts are grouped by the specific .
“none” Number of update operations that did not specify w value. These operations use the default w value of 1.
opWriteConcernCounters.delete的总和等于opcounters.delete。

opcounters

“opcounters”  : { 
   “insert”  :  ,
   “query”  :  ,
   “update”  :  ,
   “delete”  :  ,
   “getmore”  :  ,
   “command”  :  
},

opcounters
自mongod上次启动实例以来, 按数据库操作类型报告的文档 。
这些数字将随着时间的推移而增长,直 到下次重启,随着时间的推移分析这些值以跟踪数据库使用率。
注意:opcounters操作中的数据数据受多文档影响,例如批量插入或多次更新操作,将作为单个操作处理。有关更详细的文档级操作跟踪,请参阅metrics.document 。
此外,这些值反映了接收的操作,即使操作不成功也会增加。

opcounters.insert:自上次启动mongod实例以来收到的插入操作总数 。
opcounters.query:自 上次启动mongod实例以来收到的查询总数。
opcounters.update:自上次启动mongod实例以来收到的更新操作总数 。
opcounters.delete:自上次启动mongod实例以来的删除操作总数。
opcounters.getmore:自上次启动mongod实例以来“getmore”操作的总数。即使查询数目较低,此计数器也可能很高。作为复制进程的一部分,Secondary节点将发送 getMore操作
opcounters.command:自mongod上次启动实例以来向数据库发出的命令总数 。
opcounters.command计数所有的命令 ,除了写命令: insert,update,和delete。

opcountersRepl 

“opcountersRepl”  : { 
   “insert”  :  ,
   “query”  :  ,
   “update”  :  ,
   “delete”  :  ,
   “getmore”  :  ,
   “command”  :  
},

opcountersRepl:自上次启动mongod实例以来按类型报告数据库复制操作的文档。当前主机是副本集的成员时才会显示这些值。
MongoDB在复制期间序列化操作,因此这些值将与opcounters值不同。更多信息请参阅复制。
这些数字将随着时间的推移而增长,以响应数据库使用,直到下次重启。随着时间的推移分析这些值以跟踪数据库利用率。
opcountersRepl.insert:自上次启动mongod实例以来复制插入操作的总数 。
opcountersRepl.query:自 上次启动mongod实例以来复制查询的总数。
opcountersRepl.update:自上次启动mongod实例以来复制更新操作总数 。
opcountersRepl.delete:自上次启动mongod实例以来复制的删除操作总数 。
opcountersRepl.getmore:自上次启动mongod实例以来“getmore”操作的总数。即使查询数目较低,此计数器也可能很高。作为复制进程的一部分,secondary节点发送getMore操作。
opcountersRepl.command:自上次启动mongod实例以来发送到数据库的复制命令总数。

repl

"repl" : {
   "hosts" : [
         ,
         ,      
   ],
   "setName" : ,
   "setVersion" : ,
   "ismaster" : ,
   "secondary" : ,
   "primary" : ,
   "me" : ,
   "electionId" : ObjectId(""),
   "rbid" : ,
   "replicationProgress" : [
         {
            "rid" : ,
            "optime" : { ts: , term:  },
            "host" : ,
            "memberId" : 
         },
        ...
   ]
}

repl:报告副本集配置的文档。 repl仅在当前主机是副本集时存在。更多信息请参见复制。
repl.hosts:当前副本集成员的主机名和端口信息(”host:port”)的数组。
repl.setName:当前副本集名称的字符串。此值反映–replSet命令行参数或配置文件中replSetName的值。
repl.ismaster:一个布尔值,指示当前节点是否是副本集的primary节点 。
repl.secondary:一个布尔值,指示当前节点是否是副本集的 secondary成员。
repl.primary:3.0版中的新功能。
副本集的当前primary成员的主机名和端口信息(”host:port”) 。
repl.me:3.0版中的新增功能:副本集当前成员的主机名和端口信息(”host:port”)。
repl.rbid:3.0版中的新功能。回滚标识符。用于确定此mongod实例是否发生了回滚。
repl.replicationProgress:在3.2版中更改:以前名称serverStatus.repl.slaves。
3.0版中的新功能。
一个数组,副本集的每个成员报告复制进程给这个成员的一个数组文档。通常,这个成员是primary或者使用链式复制的secondary。
要输出repl,必须将repl选项传递给 serverStatus,如下所示:
db.serverStatus({ “repl”: 1 })
db.runCommand({ “serverStatus”: 1, “repl”: 1 })
repl.replicationProgress部分的内容取决于每个成员复制的源。支持内部操作,仅供内部和诊断使用。
repl.replicationProgress[n].rid:ObjectId用作副本集成员的ID。仅限内部使用。
repl.replicationProgress[n].optime:从这个成员报告的,成员应用的oplog最后一个操作信息。
repl.replicationProgress[n].host:主机的名称[hostname]:[port]格式为副本集的成员。
repl.replicationProgress[n].memberID:此成员的副本集的整数标识符。

security

"security" : {
   "SSLServerSubjectName": ,
   "SSLServerHasCertificateAuthority": ,
   "SSLServerCertificateExpirationDate": 
},

security:3.0版中的新功能。报告安全配置和详细信息的文档。仅在针对TLS / SSL编译的mongod实例中出现。
security.SSLServerSubjectName: net.ssl.PEMKeyFile指定的TLS / SSL证书关联的主题名称 。
security.SSLServerHasCertificateAuthority:布尔值true表示net.ssl.PEMKeyFile 指定的TLS / SSL证书与证书颁发机构关联时。false表示TLS / SSL证书是自签名的。
security.SSLServerCertificateExpirationDate:
一个日期对象,表示由net.ssl.PEMKeyFile指定的TLS / SSL证书到期的日期 。

sharing

版本3.2中的新功能:运行时mongos,该命令返回分片信息。
在版本3.6中更改:从MongoDB 3.6开始,分片成员返回分片信息。

{
   "configsvrConnectionString" : "csRS/cfg1.example.net:27019,cfg2.example.net:27019,cfg2.example.net:27019",
   "lastSeenConfigServerOpTime" : {
      "ts" : Timestamp(1517462189, 1),
      "t" : NumberLong(1)
   },
   "maxChunkSizeInBytes" : NumberLong(67108864)
}

sharding:包含分片集群数据的文档。lastSeenConfigServerOpTime仅存在在mongos或分片成员,而配置节点不存在。
sharding.configsvrConnectionString:配置服务器的连接字符串。
sharding.lastSeenConfigServerOpTime:
mongos或shard成员可见,CSRS primary的最新 optime。optime文档包括:
ts,操作的时间戳。
t,term表示操作在primary上最初生成的时间。
lastSeenConfigServerOpTime仅存在在使用CSRS(副本集)的分片集群中。
sharding.maxChunkSizeInBytes:版本3.6中的新功能。块的最大大小限制。如果最近在配置服务器上更新了块大小,则maxChunkSizeInBytes可能无法反映最新值。

shardingStatistics 

4.0版中的新功能。

"shardingStatistics" : {
   "countStaleConfigErrors" : NumberLong(),
   "countDonorMoveChunkStarted" : NumberLong(),
   "totalDonorChunkCloneTimeMillis" : NumberLong(),
   "totalCriticalSectionCommitTimeMillis" : NumberLong(),
   "totalCriticalSectionTimeMillis" : NumberLong(),
   "catalogCache" : {
      "numDatabaseEntries" : NumberLong(),
      "numCollectionEntries" : NumberLong(),
      "countStaleConfigErrors" : NumberLong(),
      "totalRefreshWaitTimeMicros" : NumberLong(),
      "numActiveIncrementalRefreshes" : NumberLong(),
      "countIncrementalRefreshesStarted" : NumberLong(),
      "numActiveFullRefreshes" : NumberLong(),
      "countFullRefreshesStarted" : NumberLong(),
      "countFailedRefreshes" : NumberLong()
   }
},

shardingStatistics:分片集群上元数据刷新的指标的文档。
shardingStatistics.countStaleConfigErrors:线程命中陈旧配置异常的总次数。由于陈旧的配置异常触发元数据的刷新,因此该数字大致与元数据刷新的数量成比例。仅存在在正在运行的分片上。
shardingStatistics.countDonorMoveChunkStarted:作为块迁移过程的一部分, moveChunk 命令在分片上启动的总次数(此节点是其成员)。这个数字都会增加不论迁移是否成功。仅存在在运行分片上。
shardingStatistics.totalDonorChunkCloneTimeMillis:从当前shard块迁移的克隆阶段所占用的累积时间(以毫秒为单位),此节点是该节点的成员。具体而言,对于从此分片的每次迁移,跟踪时间从发起moveChunk命令开始, 结束于目标分片进入追赶阶段之前,应用在块迁移期间发生的更改 。仅存在在运行的分片上。
shardingStatistics.totalCriticalSectionCommitTimeMillis:从此分片块迁移过程中的更新元数据阶段所花费的累积时间(以毫秒为单位)。在更新元数据阶段,将阻止集合上的所有操作。仅存在在运行的分片上。
shardingStatistics.totalCriticalSectionTimeMillis:从此分片块迁移的追赶阶段和更新元数据阶段所占用的累积时间(以毫秒为单位),此节点是该节点的成员。
要计算追赶阶段的持续时间为
totalCriticalSectionTimeMillis – totalCriticalSectionCommitTimeMillis
仅存在于在运行分片上运行时出现。
shardingStatistics.catalogCache:集群路由信息缓存的统计信息的文档。
shardingStatistics.catalogCache.numDatabaseEntries:
当前在编目缓存中的数据库条目总数。
shardingStatistics.catalogCache.numCollectionEntries:当前位于编目缓存中的集合条目总数(跨所有数据库)。
shardingStatistics.catalogCache.countStaleConfigErrors:线程命中过时配置异常的总次数。过时的配置异常会触发元数据的刷新。
shardingStatistics.catalogCache.totalRefreshWaitTimeMicros:线程必须等待刷新元数据的累积时间(以微秒为单位)。
shardingStatistics.catalogCache.numActiveIncrementalRefreshes:当前正在等待的增量编目缓存刷新的数量。
shardingStatistics.countIncrementalRefreshesStarted:已启动的累计增量刷新次数。
shardingStatistics.catalogCache.numActiveFullRefreshes:正在等待的全量编目缓存刷新的数量。
shardingStatistics.catalogCache.countFullRefreshesStarted:已启动的累计全量刷新数。
shardingStatistics.catalogCache.countFailedRefreshes:已失败的全量或增量刷新的累计数量。

storageEngine 

3.0版中的新功能。

"storageEngine" : {
   "name" : ,
   "supportsCommittedReads" : ,
   "persistent" : 
},

storageEngine:包含当前存储引擎数据的文档。
storageEngine.name:当前存储引擎的名称。
storageEngine.supportsCommittedReads:版本3.2中的新功能。
一个布尔值,表示存储引擎是否支持”majority” read concern。
storageEngine.persistent:版本3.2.6中的新功能。一个布尔值,表示存储引擎是否将数据持久化到磁盘。

transactions

版本3.6.3中的新功能。

"transactions" : {
   "retriedCommandsCount" : ,
   "retriedStatementsCount" : ,
   "transactionsCollectionWriteCount" : ,
   "currentActive" : ,
   "currentInactive" : ,
   "currentOpen" : ,
   "totalAborted" : ,
   "totalCommitted" : ,
   "totalStarted" : 
}

transactions:包含有关可重试写入和 多文档事务的数据的文档。
transactions.retriedCommandsCount:相应的可重试写入命令已经提交之后收到的重试总数。也就是说,即使写入已成功并且在config.transactions 集合中存在的事务和会话的关联记录,可重试写入继续尝试,例如客户端的初始写入响应丢失。
注意:MongoDB不会重新执行已提交的写入。
总数包括所有会话。总数不包括在内部块迁移时的发生的可重试写入。
版本3.6.3中的新功能。
transactions.retriedStatementsCount:与重试命令 transactions.retriedCommandsCount关联的写语句总数。
注意:MongoDB不会重新执行已提交的写入。
总数不包括在内部块迁移时的发生的可重试写入。
版本3.6.3中的新功能。
transactions.transactionsCollectionWriteCount:提交新的可重试写入语句时触发的对config.transactions 集合的写入总数。
对于更新和删除命令,由于只有单个文档操作可以重试,因此每个语句都有一个写入。
对于插入操作,插入的每批文档有一次写入,除非失败导致每个文档单独插入。
总数包括迁移发生时部分写入服务器config.transactions 集合的写入。
版本3.6.3中的新功能。
transactions.currentActive:当前正在执行命令的打开事务的总数。版本4.0.2中的新功能。
transactions.currentInactive:当前未执行命令的打开事务的总数。版本4.0.2中的新功能。
transactions.currentOpen:开放事务总数。当第一个命令作为该事务的一部分运行时,将打开一个事务,并在事务提交或中止之前保持打开状态。
版本4.0.2中的新功能。
transactions.totalAborted:自mongod进程上次启动以来在此服务器上中止的事务总数 。版本4.0.2中的新功能。
transactions.totalCommitted:自mongod进程上次启动以来在此服务器上提交的事务总数 。版本4.0.2中的新功能。
transactions.totalStarted:自mongod进程上次启动以来在此服务器上启动的事务总数 。版本4.0.2中的新功能。

transportSecurity ¶

在4.0.2版本新增功能:(3.6.7+和3.4.17+也有)

"transportSecurity" : {
   "1.0" : ,
   "1.1" : ,
   "1.2" : ,
   "1.3" : ,
   "unknown" :
},

transportSecurity.在4.0.2版本新增功能:(3.6.7+和3.4.17+也有)
mongod实例或mongos实例的累计TLS 连接数。重启后重置该值。

wiredTiger 

wiredTiger仅在使用WiredTiger存储引擎时才会显示信息。一些统计信息,例如 wiredTiger.LSM,服务器roll up。

"wiredTiger" : {
   "uri" : "statistics:",
   "LSM" : {
         "sleep for LSM checkpoint throttle" : ,
         "sleep for LSM merge throttle" : ,
         "rows merged in an LSM tree" : ,
         "application work units currently queued" : ,
         "merge work units currently queued" : ,
         "tree queue hit maximum" : ,
         "switch work units currently queued" : ,
         "tree maintenance operations scheduled" : ,
         "tree maintenance operations discarded" : ,
         "tree maintenance operations executed" : 
   },
   "async" : {
         "number of allocation state races" : ,
         "number of operation slots viewed for allocation" : ,
         "current work queue length" : ,
         "number of flush calls" : ,
         "number of times operation allocation failed" : ,
         "maximum work queue length" : ,
         "number of times worker found no work" : ,
         "total allocations" : ,
         "total compact calls" : ,
         "total insert calls" : ,
         "total remove calls" : ,
         "total search calls" : ,
         "total update calls" : 
   },
   "block-manager" : {
         "mapped bytes read" : ,
         "bytes read" : ,
         "bytes written" : ,
         "mapped blocks read" : ,
         "blocks pre-loaded" : ,
         "blocks read" : ,
         "blocks written" : 
   },
   "cache" : {
         "tracked dirty bytes in the cache" : ,
         "tracked bytes belonging to internal pages in the cache" : ,
         "bytes currently in the cache" : ,
         "tracked bytes belonging to leaf pages in the cache" : ,
         "maximum bytes configured" : ,
         "tracked bytes belonging to overflow pages in the cache" : ,
         "bytes read into cache" : ,
         "bytes written from cache" : ,
         "pages evicted by application threads" : ,
         "checkpoint blocked page eviction" : ,
         "unmodified pages evicted" : ,
         "page split during eviction deepened the tree" : ,
         "modified pages evicted" : ,
         "pages selected for eviction unable to be evicted" : ,
         "pages evicted because they exceeded the in-memory maximum" : ,
         "pages evicted because they had chains of deleted items" : ,
         "failed eviction of pages that exceeded the in-memory maximum" : ,
         "hazard pointer blocked page eviction" : ,
         "internal pages evicted" : ,
         "maximum page size at eviction" : ,
         "eviction server candidate queue empty when topping up" : ,
         "eviction server candidate queue not empty when topping up" : ,
         "eviction server evicting pages" : ,
         "eviction server populating queue, but not evicting pages" : ,
         "eviction server unable to reach eviction goal" : ,
         "internal pages split during eviction" : ,
         "leaf pages split during eviction" : ,
         "pages walked for eviction" : ,
         "eviction worker thread evicting pages" : ,
         "in-memory page splits" : ,
         "in-memory page passed criteria to be split" : ,
         "lookaside table insert calls" : ,
         "lookaside table remove calls" : ,
         "percentage overhead" : ,
         "tracked dirty pages in the cache" : ,
         "pages currently held in the cache" : ,
         "pages read into cache" : ,
         "pages read into cache requiring lookaside entries" : ,
         "pages written from cache" : ,
         "page written requiring lookaside records" : ,
         "pages written requiring in-memory restoration" : 
   },
   "connection" : {
         "pthread mutex condition wait calls" : ,
         "files currently open" : ,
         "memory allocations" : ,
         "memory frees" : ,
         "memory re-allocations" : ,
         "total read I/Os" : ,
         "pthread mutex shared lock read-lock calls" : ,
         "pthread mutex shared lock write-lock calls" : ,
         "total write I/Os" : 
   },
   "cursor" : {
         "cursor create calls" : ,
         "cursor insert calls" : ,
         "cursor next calls" : ,
         "cursor prev calls" : ,
         "cursor remove calls" : ,
         "cursor reset calls" : ,
         "cursor restarted searches" : ,
         "cursor search calls" : ,
         "cursor search near calls" : ,
         "truncate calls" : ,
         "cursor update calls" : 
   },
   "data-handle" : {
         "connection data handles currently active" : ,
         "session dhandles swept" : ,
         "session sweep attempts" : ,
         "connection sweep dhandles closed" : ,
         "connection sweep candidate became referenced" : ,
         "connection sweep dhandles removed from hash list" : ,
         "connection sweep time-of-death sets" : ,
         "connection sweeps" : 
   },
   "log" : {
         "total log buffer size" : ,
         "log bytes of payload data" : ,
         "log bytes written" : ,
         "yields waiting for previous log file close" : ,
         "total size of compressed records" : ,
         "total in-memory size of compressed records" : ,
         "log records too small to compress" : ,
         "log records not compressed" : ,
         "log records compressed" : ,
         "log flush operations" : ,
         "maximum log file size" : ,
         "pre-allocated log files prepared" : ,
         "number of pre-allocated log files to create" : ,
         "pre-allocated log files not ready and missed" : ,
         "pre-allocated log files used" : ,
         "log release advances write LSN" : ,
         "records processed by log scan" : ,
         "log scan records requiring two reads" : ,
         "log scan operations" : ,
         "consolidated slot closures" : ,
         "written slots coalesced" : ,
         "logging bytes consolidated" : ,
         "consolidated slot joins" : ,
         "consolidated slot join races" : ,
         "busy returns attempting to switch slots" : ,
         "consolidated slot join transitions" : ,
         "consolidated slot unbuffered writes" : ,
         "log sync operations" : ,
         "log sync_dir operations" : ,
         "log server thread advances write LSN" : ,
         "log write operations" : ,
         "log files manually zero-filled" : 
   },
   "reconciliation" : {
         "pages deleted" : ,
         "fast-path pages deleted" : ,
         "page reconciliation calls" : ,
         "page reconciliation calls for eviction" : ,
         "split bytes currently awaiting free" : ,
         "split objects currently awaiting free" : 
   },
   "session" : {
         "open cursor count" : ,
         "open session count" : 
   },
   "thread-yield" : {
         "page acquire busy blocked" : ,
         "page acquire eviction blocked" : ,
         "page acquire locked blocked" : ,
         "page acquire read blocked" : ,
         "page acquire time sleeping (usecs)" : 
   },
   "transaction" : {
         "transaction begins" : ,
         "transaction checkpoints" : ,
         "transaction checkpoint generation" : ,
         "transaction checkpoint currently running" : ,
         "transaction checkpoint max time (msecs)" : ,
         "transaction checkpoint min time (msecs)" : ,
         "transaction checkpoint most recent time (msecs)" : ,
         "transaction checkpoint total time (msecs)" : ,
         "transactions committed" : ,
         "transaction failures due to cache overflow" : ,
         "transaction range of IDs currently pinned by a checkpoint" : ,
         "transaction range of IDs currently pinned" : ,
         "transaction range of IDs currently pinned by named snapshots" : ,
         "transactions rolled back" : ,
         "number of named snapshots created" : ,
         "number of named snapshots dropped" : ,
         "transaction sync calls" : 
   },
   "concurrentTransactions" : {
         "write" : {
            "out" : ,
            "available" : ,
            "totalTickets" : 
         },
         "read" : {
            "out" : ,
            "available" : ,
            "totalTickets" : 
         }
   }
},

wiredTiger.uri:3.0版中的新功能。一个字符串。供MongoDB内部使用一个字符。
wiredTiger.LSM:3.0版中的新功能。返回LSM(Log-Structured Merge)树的统计信息的文档。这些值反映了此服务器中使用的所有LSM树的统计信息。
wiredTiger.async:3.0版中的新功能。返回与异步操作API相关的统计信息的文档。MongoDB没有使用它。
wiredTiger.block-manager:3.0版中的新功能。返回块管理器操作统计信息的文档。
wiredTiger.cache:3.0版中的新功能:返回缓存和缓存中页面移除的统计信息的文档。
以下描述了一些 wiredTiger.cache的key统计数据:
wiredTiger.cache.maximum bytes configured:最大缓存大小。
wiredTiger.cache.bytes currently in the cache:当前在缓存中的数据的字节大小。该值不应大于maximum bytesconfigured。
wiredTiger.cache.unmodified pages evicted:页面移除的主要统计数据。
wiredTiger.cache.tracked dirty bytes in the cache:缓存中脏数据的大小(以字节为单位)。该值应小于bytes currently in the cache。
wiredTiger.cache.pages read into cache:读入缓存的页数。 wiredTiger.cache.pages read intocache和wiredTiger.cache.pages written from cache可以提供I / O 信息。
wiredTiger.cache.pages written from cache:从缓存写入的页数。 wiredTiger.cache.pages written fromcache和wiredTiger.cache.pages read into cache可以提供I / O的信息。
要调整WiredTiger内部缓存的大小,请参阅storage.wiredTiger.engineConfig.cacheSizeGB和 –wiredTigerCacheSizeGB。避免将WiredTiger内部缓存大小增加到其默认值以上。
wiredTiger.connection:3.0版中的新功能。返回与WiredTiger连接相关的统计信息的文档。
wiredTiger.cursor:3.0版中的新功能。返回WiredTiger游标统计信息的文档。
wiredTiger.data-handle:3.0版中的新功能。返回有关数据句柄和扫描的统计信息的文档。
wiredTiger.log:3.0版中的新功能。返回WiredTiger的预写日志的统计信息的文档。
参阅:日记和WiredTiger存储引擎
wiredTiger.reconciliation:3.0版中的新功能。返回协调进程统计信息的文档。
wiredTiger.session:3.0版中的新功能。返回会话的打开游标计数和打开会话计数的文档。
wiredTiger.thread-yield:3.0版中的新功能。页面请求量的统计信息的文档。
wiredTiger.transaction:3.0版中的新功能。返回有关事务检查点和操作的统计信息的文档。
wiredTiger.transaction.transaction checkpoint most recent time:创建最新检查点的时间量(以毫秒为单位)。在固定写入负载下该值增加可能表示I / O系统饱和。
wiredTiger.concurrentTransactions:3.0版中的新功能。返回允许进入WiredTiger存储引擎的读写事务并发数的信息文档。这些设置是特定于MongoDB的。
要更改并发读取和写入事务的设置,请参阅wiredTigerConcurrentReadTransactions和wiredTigerConcurrentWriteTransactions。
writeBacksQueued :
“writeBacksQueued” : ,
writeBacksQueued:
一个布尔值,指示是否有来自mongos实例排队等待重试的的操作 。通常,此值为false。另请参见writeBacks。

MEM 

“mem”  : { 
   “bits”  :  ,
   “resident”  :  ,
   “virtual”  :  ,
   “supported”  :  ,
   “mapped”  :  ,
   “mappedWithJournal”  :  
},

mem:报告mongod的系统架构和当前内存使用的文档 。
mem.bits:可选数字64或32,表示已编译的mongodb实例是32位还是64位体系结构。
mem.resident:该值mem.resident大致相当于数据库进程当前使用的RAM量(以兆字节(MB)为单位)。在正常使用期间,该值趋于增长。在专用数据库服务器中,此数字接近系统内存总量。
mem.virtual:mem.virtual显示mongod进程使用的虚拟内存的总量(以兆字节(MB)为单位)。
日志启用并且使用MMAPv1存储引擎,mem.virtual值至少两倍的mem.mapped。如果 mem.virtual值显着大于 mem.mapped(例如3倍或更多倍),则这可能表示内存泄漏。
mem.supported:一个布尔值,指示底层系统是否支持扩展内存信息。如果为false,表示系统不支持扩展内存信息,则数据库服务器可能无法访问其他 mem值。
mem.mapped:仅适用于MMAPv1存储引擎。数据库的映射内存量(以兆字节(MB)为单位)。由于MongoDB使用内存映射文件,因此该值可能大致等于数据库或数据库的总大小。
mem.mappedWithJournal:仅适用于MMAPv1存储引擎。映射内存量,以兆字节(MB)为单位,包括用于journaling的内存。该值始终是值的两倍 mem.mapped。仅在启用 journaling 功能时才包含此字段。
mem.note:mem.note如果mem.supported为false,则显示 该字段。
该mem.note字段显示文本:”not all mem info support on thisplatform”

metrics

"metrics" : {
   "commands": {
         "": {
            "failed": ,
            "total": 
         }
   },
   "cursor" : {
         "timedOut" : NumberLong(),
         "open" : {
            "noTimeout" : NumberLong(),
            "pinned" : NumberLong(),
            "multiTarget" : NumberLong(),
            "singleTarget" : NumberLong(),
            "total" : NumberLong(),
         }
   },
   "document" : {
         "deleted" : NumberLong(),
         "inserted" : NumberLong(),
         "returned" : NumberLong(),
         "updated" : NumberLong()
   },
   "getLastError" : {
         "wtime" : {
            "num" : ,
            "totalMillis" : 
         },
         "wtimeouts" : NumberLong()
   },
   "operation" : {
         "scanAndOrder" : NumberLong(),
         "writeConflicts" : NumberLong()
   },
   "queryExecutor": {
         "scanned" : NumberLong(),
         "scannedObjects" : NumberLong()
   },
   "record" : {
         "moves" : NumberLong()
   },
   "repl" : {
      "executor" : {
         "pool" : {
            "inProgressCount" : 
         },
         "queues" : {
            "networkInProgress" : ,
            "sleepers" : 
         },
         "unsignaledEvents" : ,
         "shuttingDown" : ,
         "networkInterface" : 
      },
      "apply" : {
         "attemptsToBecomeSecondary" : ,
         "batches" : {
            "num" : ,
            "totalMillis" : 
         },
         "ops" : 
      },
      "buffer" : {
         "count" : ,
         "maxSizeBytes" : ,
         "sizeBytes" : 
      },
      "initialSync" : {
         "completed" : ,
         "failedAttempts" : ,
         "failures" : ,
      },
      "network" : {
         "bytes" : ,
         "getmores" : {
            "num" : ,
            "totalMillis" : 
         },
         "ops" : ,
         "readersCreated" : 
      },
      "preload" : {
         "docs" : {
            "num" : ,
            "totalMillis" : 
         },
         "indexes" : {
            "num" : ,
            "totalMillis" : 
         }
      }
   },
   "storage" : {
         "freelist" : {
            "search" : {
               "bucketExhausted" : ,
               "requests" : ,
               "scanned" : 
            }
         }
   },
   "ttl" : {
         "deletedDocuments" : NumberLong(),
         "passes" : NumberLong()
   }
},

metrics:返回反映当前使用情况和正在运行的mongod实例状态的各种统计信息的文档。
metrics.commands:3.0版中的新功能。报告数据库命令使用情况的文档。这些字段metrics.commands是数据库命令的名称,每个值都是一个文档,用于报告执行的命令总数以及失败的执行次数。
metrics.commands..failed:mongod中 失败 的次数。
metrics.commands..total:mongod 中执行 的次数。
metrics.document:反映文档访问和修改模式的文档。将这些值与opcounters 文档中的数据进行比较,该数据跟踪总操作数。
metrics.document.deleted:删除的文档总数。
metrics.document.inserted:插入的文档总数。
metrics.document.returned:查询返回的文档总数。
metrics.document.updated:更新的文件总数。
metrics.executor:版本3.2中的新功能。报告复制执行器的各种统计信息的文档。
metrics.getLastError:报告getLastError使用的文件。
metrics.getLastError.wtime:报告getLastError操作计数的文档,其w参数大于1。
metrics.getLastError.wtime.num:指定write concern(即w)的getLastError 操作总数,即等待副本集的一个或多个成员确认写入操作(即w大于1)。
metrics.getLastError.wtime.totalMillis:指定write concern(即w)mongod写操作操作所花费的总时间(以毫秒为单位w),即等待副本集的一个或多个成员确认写操作(即w大于1)。
metrics.getLastError.wtimeouts:write concern操作由于wtimeout阈值而 超时到中getLastError的次数。
metrics.operation:用于保存MongoDB使用特定操作类型处理的几种类型的更新和查询操作的计数器文档。
metrics.operation.fastmod:在3.4中删除。如果使用MMAPv1存储引擎,那么更新操作数既不会导致文档增长也不需要更新索引。例如,此计数器将记录更新操作,使用$inc 操作使用运算符来递增未被索引的字段的值。
metrics.operation.idhack:在3.4中删除。包含该_id字段的查询数。对于这些查询,MongoDB将在该_id字段上使用默认索引并跳过所有查询执行计划。
metrics.operation.scanAndOrder:返回无法使用索引的排序操作的已排序数目的查询总数。
metrics.operation.writeConflicts:遇到写入冲突的查询总数。
metrics.queryExecutor:报告来自查询执行系统数据的文档。
metrics.queryExecutor.scanned:在查询和查询计划评估期间索引扫描的总数。此计数器totalKeysExamined与输出中的 计数器相同 explain()。
metrics.queryExecutor.scannedObjects:查询和查询计划评估期间扫描的文档总数。此计数器totalDocsExamined与explain()输出中的 计数器相同 。
metrics.record:报告与磁盘存储文件中的记录分配相关的数据的文档。
metrics.record.moves:对于MMAPv1存储引擎,metrics.record.moves 报告文档在MongoDB数据集的磁盘表示内移动的总次数。文档移动是因为操作会增加文档大小超出其分配的记录大小。
metrics.repl:报告与复制过程相关的指标的文档。 metrics.repl文档出现在所有mongod实例上,包括副本集成员的实例 。
metrics.repl.apply:从复制oplog应用到应用程序的文档。
metrics.repl.apply.batchSize:版本4.0.6中的新功能:(也可在3.6.11+中使用)
应用的oplog操作总数。该 metrics.repl.apply.batchSize在批量操作边界时的操作数目递增,而不是每次操作后递增。
要获得更精细的粒度,请参阅metrics.repl.apply.ops。
metrics.repl.apply.batches:metrics.repl.apply.batches报告在副本集的secondary成员上的oplog应用进程。有关oplog应用程序进程的更多信息,请参见 多线程复制
metrics.repl.apply.batches.num:所有数据库中应用的批次总数。
metrics.repl.apply.batches.totalMillis
mongod从oplog应用操作所花费的总时间(以毫秒为单位)。
metrics.repl.apply.ops:应用的oplog操作总数。 metrics.repl.apply.ops每次操作后递增。参阅:metrics.repl.apply.batchSize
metrics.repl.buffer:
在批量应用oplog条目之前,MongoDB会从复制源缓冲区中缓冲oplog操作。metrics.repl.buffer提供了一种跟踪oplog缓冲区的方法。有关oplog应用程序进程的更多信息,请参见 多线程复制。
metrics.repl.buffer.count:oplog缓冲区中的当前操作数。
metrics.repl.buffer.maxSizeBytes:缓冲区的最大大小。此值是mongod的常量设置,不可配置。
metrics.repl.buffer.sizeBytes:oplog缓冲区内容的当前大小。
metrics.repl.network:metrics.repl.network 报告复制过程的网络信息。
metrics.repl.network.bytes:metrics.repl.network.bytes 报告从复制同步源读取的数据总量。
metrics.repl.network.getmores:metrics.repl.network.getmores报告 getmore操作,oplog复制进程中oplog 游标的额外请求结果。
metrics.repl.network.getmores.num:metrics.repl.network.getmores.num报告getmore操作总数,从复制同步源请求其他操作的操作。
metrics.repl.network.getmores.totalMillis: 报告从getmore操作中收集数据所需的总时间 。
注意
这个数字可能非常大,因为即使getmore操作没有初始返回数据,MongoDB也会等待更多数据。
metrics.repl.network.ops:metrics.repl.network.ops 报告从复制源读取的操作总数。
metrics.repl.network.readersCreated:metrics.repl.network.readersCreated报告创建的oplog查询进程的总数。将在连接中发生错误(包括超时或网络操作)时,MongoDB将创建新的oplog查询。此外,metrics.repl.network.readersCreated每次MongoDB选择新的复制源时, 都会递增。
metrics.repl.preload: metrics.repl.preload 报告“预读”阶段,其中MongoDB将文档和索引加载到RAM中以提高复制吞吐量。有关复制过程的预读阶段的详细信息,请参阅多线程复制。
metrics.repl.preload.docs:报告在预读阶段加载到内存中的文档的文档。
metrics.repl.preload.docs.num:在复制的预读阶段加载的文档总数。
metrics.repl.preload.docs.totalMillis:复制预取阶段加载文档所花费的总时间。
metrics.repl.preload.indexes:在复制预读阶段报告加载到内存中的索引项的文档。有关预取复制阶段的详细信息,请参阅多线程复制。
metrics.repl.preload.indexes.num:作为复制预取阶段的一部分,在更新文档之前由成员加载的索引条目总数。
metrics.repl.preload.indexes.totalMillis:作为复制预读阶段的一部分,加载索引条目所花费的总时间(以毫秒为单位)。
metrics.storage.freelist.search.bucketExhausted:mongod已检查空闲列表中没有找到合适的大记录分配的次数。
metrics.storage.freelist.search.requests:mongod搜索可用记录分配的次数。
metrics.storage.freelist.search.scanned:mongod搜索可用记录分配的数量。
metrics.ttl:报告ttl索引进程的资源使用的文档 。
metrics.ttl.deletedDocuments:使用ttl索引从集合中删除的文档总数 。
metrics.ttl.passes:后台进程使用ttl索引从集合中删除文档的次数。
metrics.cursor:2.6版中的新功能。有关游标状态和使用的数据的文档。
metrics.cursor.timedOut:2.6版中的新功能。自服务器进程启动以来已超时的游标总数。如果此数字很大或以常规速率增长,则可能表示应用程序错误。
metrics.cursor.open:2.6版中的新功能。有关打开游标的数据的文档。
metrics.cursor.open.noTimeout:2.6版中的新功能。打开游标的数量,选项 DBQuery.Option.noTimeout设置为在一段时间不活动后防止超时。
metrics.cursor.open.pinned:2.6版中的新功能。“固定”打开游标的数量。
metrics.cursor.open.total:2.6版中的新功能。MongoDB为客户端维护的游标数量。因为MongoDB耗尽了未使用的游标,通常这个值很小或为零。但是,如果存在队列,过时的tailable游标或大量操作,则此值可能会上升。
metrics.cursor.open.singleTarget:3.0版中的新功能。仅针对单个分片的游标总数。仅 mongos实例报告metrics.cursor.open.singleTarget值。
metrics.cursor.open.multiTarget:3.0版中的新功能。仅针对多个分片的游标总数。仅mongos实例报告metrics.cursor.open.multiTarget值。

watchdog

版本3.6中的新功能。

复制

“watchdog”  : { 
   “checkGeneration”  : NumberLong ( ),
   “monitorGeneration”  : NumberLong ( ),
   “monitorPeriod”  :  
}

注意
watchdog仅当启用了存储节点监视程序时,该部分才会出现。
watchdog:报告存储节点监视程序状态的文档 。
watchdog.checkGeneration:自启动以来检查目录的次数。每个monitoringPeriod目录都会被多次检查。
watchdog.monitorGeneration:mongod 检查文件系统状态的次数。每个monitoringPeriod增加一次。
watchdog.monitorPeriod:watchdogPeriodSeconds设置的值。这表示状态检查之间的时间段。

原文链接:https://docs.mongodb.com/manual/reference/command/serverStatus/index.html

赞(3)
未经允许不得转载:MongoDB中文社区 » serverStatus详解

评论 抢沙发

评论前必须登录!