定义
serverStatusThe
serverStatuscommand returns a document that provides an overview of the database's state. Monitoring applications can run this command at a regular interval to collect statistics about the instance.
兼容性
此命令可用于以下环境中托管的部署:
- MongoDB Atlas:用于云中 MongoDB 部署的完全托管服务
注意
所有 MongoDB Atlas 集群都支持此命令。有关 Atlas 对所有命令的支持的信息,请参阅不支持的命令。
MongoDB Enterprise:基于订阅、自我管理的 MongoDB 版本
MongoDB Community:源代码可用、免费使用且可自行管理的 MongoDB 版本
语法
该命令具有以下语法:
db.runCommand( { serverStatus: 1 } )
该值(即上面的 1)不会影响命令的操作。db.serverStatus() 命令返回大量数据。要从输出中返回特定对象或字段,请在命令后面附加对象或字段名称。
例如:
db.runCommand({ serverStatus: 1}).metrics db.runCommand({ serverStatus: 1}).metrics.commands db.runCommand({ serverStatus: 1}).metrics.commands.update
mongosh provides the db.serverStatus() wrapper for the serverStatus command.
提示
Much of the output of serverStatus is also displayed dynamically by mongostat. See the mongostat command for more information.
行为
By default, serverStatus excludes in its output:
repl 文档中的一些内容。
mirroredReads 文档。
要包含默认排除的字段,请在命令中指定顶层字段并将其设置为 1。要排除默认包含的字段,请指定该字段并将其设置为 0。您可以指定顶层字段或嵌入字段。
例如,以下操作会排除输出中的 repl、metrics 和locks 信息。
db.runCommand( { serverStatus: 1, repl: 0, metrics: 0, locks: 0 } )
例如,以下操作会排除输出中嵌入的 histogram 字段。
db.runCommand( { serverStatus: 1, metrics: { query: { multiPlanner: { histograms: false } } } } )
以下示例在输出中包含所有 repl 信息:
db.runCommand( { serverStatus: 1, repl: 1 } )
排除所有可选字段
从MongoDB 7.0.38 开始,您可以通过指定 none: 1 从 serverStatus 输出中排除所有可选字段。排除所有可选字段后,您可以指定要包含的字段。
此示例使用 none 最初从输出中排除所有可选字段,然后包含 locks文档。
db.runCommand({ serverStatus: 1, none: 1, locks: 1 })
初始化
The statistics reported by serverStatus are reset when the mongod server is restarted.
此命令始终返回一个值,即使对新数据库也是如此。相关命令 db.serverStatus() 并不总是返回值,除非特定指标的计数器开始增加。
运行更新查询后,db.serverStatus() 和db.runCommand({ serverStatus: 1}) 都返回相同的值。
{ arrayFilters : Long("0"), failed : Long("0"), pipeline : Long("0"), total : Long("1") }
包括 latchAnalysis
By default, the latchAnalysis information is not included in the output. To return latchAnalysis information, you must explicitly specify the inclusion:
db.runCommand( { serverStatus: 1, latchAnalysis: 1 } )
更改tcmalloc 详细程度
默认情况下,输出中包含 tcmalloc 信息。本部分提供数据库的内存分配统计信息。要更改 tcmalloc 部分的详细程度,请指定一个介于 0 和2(含)之间的整数:
db.runCommand( { serverStatus: 1, tcmalloc: <int> } )
该命令的行为如下:
默认情况下,
tcmalloc设置为1。传递较大的整数值会提高详细程度。
传递
0或false将忽略输出中的tcmalloc部分。传递任何其他输入都会采用默认设置。
有关 MongoDB 如何分配内存的更多信息,请参阅 TCMalloc。
输出
注意
输出字段因 MongoDB 的版本、底层操作系统平台、存储引擎和节点类型(包括 mongos、mongod 或副本集节点)不同而异。
For the serverStatus output specific to the version of your MongoDB, refer to the appropriate version of the MongoDB Manual.
断言
asserts : { regular : <num>, warning : <num>, msg : <num>, user : <num>, rollovers : <num> },
asserts一个文档,其中报告自 MongoDB 进程启动以来引发的断言数量。断言是对数据库运行时发生的错误的内部检查,可以帮助诊断 MongoDB 服务器的问题。非零断言值表示断言错误,这种错误并不常见,也不是什么值得立即关注的问题。生成断言的错误可以记录在日志文件中,或直接返回到客户端应用程序以获取更多信息。
asserts.user自上次启动 MongoDB 进程以来发生的“用户断言”的数量。这些是用户可能生成的错误,例如磁盘空间不足或重复密钥。您可以通过修复应用程序或部署的问题来防止这些断言。服务器日志中关于“用户断言”的信息可能有限。要了解有关“用户断言”来源的更多信息,请检查应用程序日志中的应用程序错误。
asserts.rollovers自上次启动MongoDB进程以来断言计数器滚动的次数。在 个230 断言后,计数器将翻转为零。使用此值可为
asserts数据结构中的其他值提供上下文。
batchedDeletes
batchedDeletes: { batches: <num>, docs: <num>, stagedSizeBytes: <num>, timeInBatchMillis: <num>, refetchesDueToYield: <num> },
报告与所有批量删除相关的指标的文档。
batchedDeletes 返回以下指标:
衡量标准 | 说明 |
|---|---|
| |
| |
| |
| |
|
bucketCatalog
bucketCatalog : { numBuckets : <num>, numOpenBuckets : <num>, numIdleBuckets : <num>, memoryUsage : <num> }
报告时间序列集合的内部存储相关指标的文档。
bucketCatalog 返回以下指标:
衡量标准 | 说明 |
|---|---|
| 内部存储时间序列数据的存储桶的数量。 |
| 活动的、未提交的写入存储桶的数量。 |
| 未满且可存储传入的时间序列数据的存储桶的数量。 |
| 为冲突管理而跟踪的存储桶总数。这包括存储桶目录中打开的存储桶,以及任何正在通过更新和删除命令直接写入的存储桶。 |
| 存储桶目录的当前纪元。存储桶目录从 0 纪元开始,并在存储桶被清除时递增。尝试插入到存储桶中会导致存储桶被删除(如果已被清除),或将其更新到当前纪元。 |
| 具有跟踪存储桶的纪元数量。 |
| 一组存储桶已被清除,但这些存储桶的移除被推迟的次数。这可能是由于删除集合、在分片集合中移动区块或选举等事件造成的。 |
您还可以使用 $collStats 聚合管道阶段来查找时间序列指标。要了解更多信息,请参阅时间序列集合上的 storageStats 输出。
catalogStats
5.1版本新增。
catalogStats: { collections: <num>, capped: <num>, views: <num>, timeseries: <num>, internalCollections: <num>, internalViews: <num>, csfle: <num>, queryableEncryption: <num>, systemProfile: <num> }
catalogStats.csfle7.0.1版本新增。
The total number of collections configured for Client-Side Field Level Encryption (collections with an encrypted validator).
catalogStats.queryableEncryption7.0.1版本新增。
The total number of collections configured for Queryable Encryption (collections with
encryptedFields).
catalogStats.systemProfile所有数据库上的
profile集合总数。
连接
connections : { current : <num>, available : <num>, totalCreated : <num>, rejected : <num>, // Added in MongoDB 6.3 active : <num>, threaded : <num>, exhaustIsMaster : <num>, exhaustHello : <num>, awaitingTopologyChanges : <num>, loadBalanced : <num> },
connections.currentThe number of incoming connections from clients to the database server. This includes connections from the current shell session and from other servers, such as replica set members and
mongosinstances. Consider the value ofconnections.availablefor additional context.
connections.availableThe number of unused incoming connections available. Consider this value in combination with the value of
connections.currentto understand the connection load on the database, and the UNIXulimitSettings for Self-Managed Deployments document for more information about system thresholds on available connections.
connections.rejected6.3版本新增。
服务器因服务器没有能力接受更多连接或达到
net.maxIncomingConnections设置而拒绝的传入连接的数量。
connections.exhaustIsMaster最后一个请求是指定 exhausAllowed 的
isMaster请求的连接的数量。注意
如果运行的是 MongoDB 5.0 或更高版本,请勿使用
isMaster命令。请改用hello。
connections.exhaustHello最后请求是指定 ExhaustAllowed 的
hello请求的连接的数量。版本 5.0 中的新增功能。
defaultRWConcern
defaultRWConcern 部分提供有关全局默认读关注或写关注设置的本地副本的信息。数据可能已过时或已过期。有关更多信息,请参阅 getDefaultRWConcern。
defaultRWConcern : { defaultReadConcern : { level : <string> }, defaultWriteConcern : { w : <string> | <int>, wtimeout : <int>, j : <bool> }, defaultWriteConcernSource: <string>, defaultReadConcernSource: <string>, updateOpTime : Timestamp, updateWallClockTime : Date, localUpdateWallClockTime : Date }
defaultRWConcern.defaultReadConcern上次已知的全局默认读关注设置。
If
serverStatusdoes not return this field, the global default read concern has either not been set or has not yet propagated to the instance.
defaultRWConcern.defaultReadConcern.level上次已知的全局默认读关注级别设置。
If
serverStatusdoes not return this field, the global default for this setting has either not been set or has not yet propagated to the instance.
defaultRWConcern.defaultWriteConcern上次已知的全局默认写关注设置。
If
serverStatusdoes not return this field, the global default write concern has either not been set or has not yet propagated to the instance.
defaultRWConcern.defaultWriteConcern.w上次已知的全局默认 w 设置。
If
serverStatusdoes not return this field, the global default for this setting has either not been set or has not yet propagated to the instance.
defaultRWConcern.defaultWriteConcern.wtimeout上次已知的全局默认 wtimeout 设置。
If
serverStatusdoes not return this field, the global default for this setting has either not been set or has not yet propagated to the instance.
defaultRWConcern.defaultWriteConcernSource默认写关注的来源。默认情况下,该值为
"implicit"。使用setDefaultRWConcern完成设置默认写关注后,该值即变为"global"。版本 5.0 中的新增功能。
defaultRWConcern.defaultReadConcernSource默认读关注的来源。默认情况下,该值为
"implicit"。使用setDefaultRWConcern完成设置默认读关注后,该值即变为"global"。版本 5.0 中的新增功能。
defaultRWConcern.updateOpTimeThe timestamp when the instance last updated its copy of any global read or write concern settings. If the
defaultRWConcern.defaultReadConcernanddefaultRWConcern.defaultWriteConcernfields are absent, this field indicates the timestamp when the defaults were last unset.
defaultRWConcern.updateWallClockTimeThe wall clock time when the instance last updated its copy of any global read or write concern settings. If the
defaultRWConcern.defaultReadConcernanddefaultRWConcern.defaultWriteConcernfields are absent, this field indicates the time when the defaults were last unset.
defaultRWConcern.localUpdateWallClockTimeThe local system wall clock time when the instance last updated its copy of any global read or write concern setting. If this field is the only field under
defaultRWConcern, the instance has never had knowledge of a global default read or write concern setting.
electionMetrics
electionMetrics 部分提供有关此 mongod 实例试图成为主节点而调用的选举的信息:
electionMetrics : { stepUpCmd : { called : Long("<num>"), successful : Long("<num>") }, priorityTakeover : { called : Long("<num>"), successful : Long("<num>") }, catchUpTakeover : { called : Long("<num>"), successful : Long("<num>") }, electionTimeout : { called : Long("<num>"), successful : Long("<num>") }, freezeTimeout : { called : Long("<num>"), successful : Long("<num>") }, numStepDownsCausedByHigherTerm : Long("<num>"), numCatchUps : Long("<num>"), numCatchUpsSucceeded : Long("<num>"), numCatchUpsAlreadyCaughtUp : Long("<num>"), numCatchUpsSkipped : Long("<num>"), numCatchUpsTimedOut : Long("<num>"), numCatchUpsFailedWithError : Long("<num>"), numCatchUpsFailedWithNewTerm : Long("<num>"), numCatchUpsFailedWithReplSetAbortPrimaryCatchUpCmd : Long("<num>"), averageCatchUpOps : <double> }
electionMetrics.stepUpCmd当主节点降级后,作为选举移交的一部分,由
mongod实例调用的选举指标。The
stepUpCmdincludes both the number of elections called and the number of elections that succeeded.
electionMetrics.priorityTakeovermongod实例调用的选举指标,因为其priority高于主节点。The
electionMetrics.priorityTakeoverincludes both the number of elections called and the number of elections that succeeded.
electionMetrics.catchUpTakeovermongod实例调用的选举指标,因为它比主节点的日期更近。The
catchUpTakeoverincludes both the number of elections called and the number of elections that succeeded.
electionMetrics.electionTimeoutmongod实例调用的选举指标,因为它无法在settings.electionTimeoutMillis内到达主节点。The
electionTimeoutincludes both the number of elections called and the number of elections that succeeded.
electionMetrics.freezeTimeoutmongod实例在其freeze period(在此期间,节点无法寻求选举)到期后调用的选举指标。The
electionMetrics.freezeTimeoutincludes both the number of elections called and the number of elections that succeeded.
electionMetrics.numStepDownsCausedByHigherTermmongod实例因看到更高任期(具体来说,其他节点参与了额外选举)而降级的次数。
electionMetrics.numCatchUps作为新当选主节点的
mongod实例必须赶上已知最高 oplog 条目的选举次数。
electionMetrics.numCatchUpsSucceeded作为新当选主节点的
mongod实例成功赶上已知最高 oplog 条目的次数。
electionMetrics.numCatchUpsAlreadyCaughtUp作为新当选主节点的
mongod实例由于当选时已被赶上而结束其追赶进程的次数。
electionMetrics.numCatchUpsSkipped作为新当选主节点的
mongod实例跳过追赶进程的次数。
electionMetrics.numCatchUpsTimedOut作为新当选主节点的
mongod实例由于settings.catchUpTimeoutMillis限制而结束其追赶进程的次数。
electionMetrics.numCatchUpsFailedWithReplSetAbortPrimaryCatchUpCmd由于
mongod收到replSetAbortPrimaryCatchUp命令而导致新当选主节点的追赶进程结束的次数。
extra_info
extra_info : { note : 'fields vary by platform', page_faults : <num> },
extra_info.page_faultsThe total number of page faults. The
extra_info.page_faultscounter may increase dramatically during moments of poor performance and may correlate with limited memory environments and larger data sets. Limited and sporadic page faults do not necessarily indicate an issue.Windows 区分涉及磁盘 I/O 的“硬”页面错误与仅需要在内存中移动页面的“软”页面错误。MongoDB 在该统计中同时计入硬页面错误和软页面错误。
flowControl
flowControl : { enabled : <boolean>, targetRateLimit : <int>, timeAcquiringMicros : Long("<num>"), locksPerKiloOp : <double>, sustainerRate : <int>, isLagged : <boolean>, isLaggedCount : <int>, isLaggedTimeMicros : Long("<num>") },
flowControl返回流量控制统计信息的文档。启用流量控制后,随着
majority commit点滞后逐渐接近flowControlTargetLagSeconds,主节点上的写入操作先获取票证才能获取锁。因此,在主节点上运行时,返回的指标很有意义。
flowControl.enabled一个布尔值,用于表示流量控制处于启用状态 (
true) 还是禁用状态 (false)。另请参阅
enableFlowControl。
flowControl.isLagged在主节点上运行时,为一个布尔值,指示流量控制是否已启用。当多数提交延迟大于配置的
flowControlTargetLagSeconds的某个百分比时,将会启用流量控制。Replication lag can occur without engaging flow control. An unresponsive secondary might lag without the replica set receiving sufficient load to engage flow control, leaving the
flowControl.isLaggedvalue atfalse.有关其他信息,请参阅流量控制。
flowControl.isLaggedCount在主节点上运行时,流量控制自上次重启以来启用的次数。当多数提交延迟大于
flowControlTargetLagSeconds的某个百分比时,将会启用流量控制。在从节点上运行时,返回的数字是占位符。
flowControl.isLaggedTimeMicros在主节点上运行时,流量控制自上次重启以来启用所用的时间。当多数提交延迟大于
flowControlTargetLagSeconds的某个百分比时,将会启用流量控制。在从节点上运行时,返回的数字是占位符。
globalLock
globalLock : { totalTime : Long("<num>"), currentQueue : { total : <num>, readers : <num>, writers : <num> }, activeClients : { total : <num>, readers : <num>, writers : <num> } },
globalLock一个文档,其中报告数据库锁定状态。
一般来说,锁文档会提供有关锁使用情况的更详细数据。
globalLock.totalTimeThe time, in microseconds, since the database last started and created the
globalLock. This is approximately equivalent to the total server uptime.
globalLock.currentQueue.totalThe total number of operations queued waiting for the lock (that is, the sum of
globalLock.currentQueue.readersandglobalLock.currentQueue.writers).A consistently small queue, particularly of shorter operations, should cause no concern. The
globalLock.activeClientsreaders and writers information provides context for this data.
globalLock.activeClients提供已连接客户端数量以及这些客户端执行的读写操作相关信息的文档。
Use this data to provide context for the
globalLock.currentQueuedata.
hedgingMetrics
仅适用于 mongos 实例。
hedgingMetrics : { numTotalOperations : <num>, numTotalHedgedOperations : <num>, numAdvantageouslyHedgedOperations : <num> },
indexBuilds
indexBuilds : { total : <num>, phases : { scanCollection : <num>, drainSideWritesTable: <num>, drainSideWritesTablePreCommit: <num>, waitForCommitQuorum: <num>, drainSideWritesTableOnCommit: <num>, processConstraintsViolatonTableOnCommit: <num>, commit: <num> } }
indexBuilds为索引构建提供指标的文档。使用这些指标来诊断索引构建问题。
注意
indexBuildsreplaces theactiveIndexBuildsfield.6.1版本新增。
indexBuilds.phases为索引构建过程的每个阶段提供计数器的文档。当索引构建达到指定阶段时,
indexBuilds.phases下的每个子字段都会递增。6.1版本新增。
IndexBulkBuilder
indexBulkBuilder: { count: <long>, resumed: <long>, filesOpenedForExternalSort: <long>, filesClosedForExternalSort: <long>, spilledRanges: <long>, bytesSpilledUncompressed: <long>, bytesSpilled: <long>, numSorted: <long>, bytesSorted: <long>, memUsage: <long> }
indexBulkBuilder提供索引批量构建器操作的指标。使用这些指标可诊断使用
createIndexes构建索引的问题、初始同步期间的集合克隆、启动后恢复的索引构建,以及外部排序器磁盘使用情况的统计信息。
indexBulkBuilder.filesClosedForExternalSortThe number of times the external sorter closed a file handle to spill data to disk. Combine this value with
filesOpenedForExternalSortto determine the number of open file handles in use by the external sorter.
indexBulkBuilder.filesOpenedForExternalSortThe number of times the external sorter opened a file handle to spill data to disk. Combine this value with
filesClosedForExternalSortto determine the number of open file handles in use by the external sorter.
indexStats
indexStats: { count: Long("<num>"), features: { '2d': { count: Long("<num>"), accesses: Long("<num>") }, '2dsphere': { count: Long("<num>"), accesses: Long("<num>") }, '2dsphere_bucket': { count: Long("<num>"), accesses: Long("<num>") }, collation: { count: Long("<num>"), accesses: Long("<num>") }, compound: { count: Long("<num>"), accesses: Long("<num>") }, hashed: { count: Long("<num>"), accesses: Long("<num>") }, id: { count: Long("<num>"), accesses: Long("<num>") }, normal: { count: Long("<num>"), accesses: Long("<num>") }, partial: { count: Long("<num>"), accesses: Long("<num>") }, prepareUnique: { count: Long("<num>"), accesses: Long("<num>") }, // Added in 7.0.14 (and 6.0.20) single: { count: Long("<num>"), accesses: Long("<num>") }, sparse: { count: Long("<num>"), accesses: Long("<num>") }, text: { count: Long("<num>"), accesses: Long("<num>") }, ttl: { count: Long("<num>"), accesses: Long("<num>") }, unique: { count: Long("<num>"), accesses: Long("<num>") }, wildcard: { count: Long("<num>"), accesses: Long("<num>") } } }
实例信息
host : <string>, advisoryHostFQDNs : <array>, version : <string>, process : <'mongod'|'mongos'>, pid : Long("<num>"), uptime : <num>, uptimeMillis : Long("<num>"), uptimeEstimate : Long("<num>"), localTime : ISODate("<Date>"),
latchAnalysis
4.4版本新增。
latchAnalysis : { <latch name> : { created : <num>, destroyed : <num>, acquired : <num>, released : <num>, contended : <num>, hierarchicalAcquisitionLevelViolations : { onAcquire : <num>, onRelease : <num> } }, ...
latchAnalysis一份报告与内部锁原语(也称为闩锁)相关的指标的文档。
要返回
latchAnalysis信息,必须明确指定包含的内容:db.runCommand( { serverStatus: 1, latchAnalysis: 1 } ) latchAnalysis为每个锁存器返回<latch name>和以下关联指标:衡量标准说明created创建锁存器的次数。
destroyed销毁锁存器的次数。
acquired获取闩锁的次数。
released释放锁存器的次数。
contended闩锁发生争用的次数。
hierarchicalAcquisitionLevelViolations仅当存在违规时才返回
包含以下字段:
onAcquire- 在获取闩锁期间违反闩锁层次结构(即闩锁级别顺序)的次数。
onRelease- 在释放闩锁期间违反闩锁层次结构(即闩锁级别顺序)的次数。
4.4版本新增。
锁
locks : { <type> : { acquireCount : { <mode> : Long("<num>"), ... }, acquireWaitCount : { <mode> : Long("<num>"), ... }, timeAcquiringMicros : { <mode> : Long("<num>"), ... }, deadlockCount : { <mode> : Long("<num>"), ... } }, ...
locks报告每个锁
<type>以及锁<modes>上的数据的文档。可能的锁
<types>是:锁类型说明ParallelBatchWriterMode代表并行批量写入模式的锁。
在早期版本中,PBWM 信息作为
Global锁信息的一部分进行报告。ReplicationStateTransition表示副本集节点状态转换采用的锁。
Global代表全局锁定。
Database代表数据库锁。
Collection代表集合锁。
Mutex代表互斥锁。
Metadata代表元数据锁。
oplog表示 oplog 上的锁。
可能的
<modes>是:锁模式说明R代表共享(S)锁。
W代表独占 (X) 锁。
r代表意向共享(IS)锁。
w代表意图独占 (IX) 锁。
所有值均为
Long()类型。
locks.<type>.acquireWaitCountNumber of times the
locks.<type>.acquireCountlock acquisitions encountered waits because the locks were held in a conflicting mode.
locks.<type>.timeAcquiringMicros锁获取的累积等待时间(以微秒为单位)。
locks.<type>.timeAcquiringMicrosdivided bylocks.<type>.acquireWaitCountgives an approximate average wait time for the particular lock mode.
logicalSessionRecordCache
logicalSessionRecordCache : { activeSessionsCount : <num>, sessionsCollectionJobCount : <num>, lastSessionsCollectionJobDurationMillis : <num>, lastSessionsCollectionJobTimestamp : <Date>, lastSessionsCollectionJobEntriesRefreshed : <num>, lastSessionsCollectionJobEntriesEnded : <num>, lastSessionsCollectionJobCursorsClosed : <num>, transactionReaperJobCount : <num>, lastTransactionReaperJobDurationMillis : <num>, lastTransactionReaperJobTimestamp : <Date>, lastTransactionReaperJobEntriesCleanedUp : <num>, sessionCatalogSize : <num> },
logicalSessionRecordCache提供有关服务器会话缓存的指标。
logicalSessionRecordCache.sessionsCollectionJobCount刷新进程在
config.system.sessions集合上运行的次数。
logicalSessionRecordCache.lastSessionsCollectionJobCursorsClosed上次刷新
config.system.sessions集合时关闭的游标数。
logicalSessionRecordCache.transactionReaperJobCount跟踪事务记录清理过程在
config.transactions集合上运行次数的数字。
logicalSessionRecordCache.lastTransactionReaperJobEntriesCleanedUp在上次清理事务记录期间删除的
config.transactions集合中的条目数。
logicalSessionRecordCache.sessionCatalogSize- 对于
mongod实例, config.transactions条目的内存缓存的大小。这对应于会话在localLogicalSessionTimeoutMinutes内未过期的可重试写入或事务。
- 对于
- 对于
mongos实例, - 包含最近
localLogicalSessionTimeoutMinutes间隔内的事务的会话的内存缓存数量。
- 对于
mem
mem : { bits : <int>, resident : <int>, virtual : <int>, supported : <boolean> },
mem一个文档,其中报告
mongod的系统架构和当前内存使用情况。
mem.residentThe value of
mem.residentis roughly equivalent to the amount of RAM, in mebibyte (MiB), currently used by the database process. During normal use, this value tends to grow. In dedicated database servers, this number tends to approach the total amount of system memory.
mem.virtualmem.virtualdisplays the quantity, in mebibyte (MiB), of virtual memory used by themongodprocess.
mem.supportedA boolean that indicates whether the underlying system supports extended memory information. If this value is false and the system does not support extended memory information, then other
memvalues may not be accessible to the database server.
mem.noteThe field
mem.noteappears ifmem.supportedis false.The
mem.notefield contains the text:'not all mem info support on this platform'.
衡量标准
metrics : { abortExpiredTransactions: { passes: <integer>, successfulKills: <integer>, timedOutKills: <integer> }, apiVersions: { <appName1>: <string>, <appName2>: <string>, <appName3>: <string> }, aggStageCounters : { <aggregation stage> : Long("<num>") }, changeStreams: { largeEventsFailed: Long("<num>"), largeEventsSplit: Long("<num>") }, commands: { <command>: { failed: Long("<num>"), validator: { total: Long("<num>"), failed: Long("<num>"), jsonSchema: Long("<num>") }, total: Long("<num>") } }, cursor : { moreThanOneBatch : Long("<num>"), timedOut : Long("<num>"), totalOpened : Long("<num>"), lifespan : { greaterThanOrEqual10Minutes : Long("<num>"), lessThan10Minutes : Long("<num>"), lessThan15Seconds : Long("<num>"), lessThan1Minute : Long("<num>"), lessThan1Second : Long("<num>"), lessThan30Seconds : Long("<num>"), lessThan5Seconds : Long("<num>") }, open : { noTimeout : Long("<num>"), pinned : Long("<num>"), multiTarget : Long("<num>"), singleTarget : Long("<num>"), total : Long("<num>") } }, document : { deleted : Long("<num>"), inserted : Long("<num>"), returned : Long("<num>"), updated : Long("<num>") }, dotsAndDollarsFields : { inserts : Long("<num>"), updates : Long("<num>") }, getLastError : { wtime : { num : <num>, totalMillis : <num> }, wtimeouts : Long("<num>"), default : { unsatisfiable : Long("<num>"), wtimeouts : Long("<num>") } }, mongos : { cursor : { moreThanOneBatch : Long("<num>"), totalOpened : Long("<num>") } }, network : { // Added in MongoDB 6.3 totalEgressConnectionEstablishmentTimeMillis : Long("<num>"), totalIngressTLSConnections : Long("<num>"), totalIngressTLSHandshakeTimeMillis : Long("<num>"), totalTimeForEgressConnectionAcquiredToWireMicros : Long("<num>"), totalTimeToFirstNonAuthCommandMillis : Long("<num>") }, operation : { killedDueToClientDisconnect : Long("<num>"), // Added in MongoDB 7.1 (*Also available in 7.0.5*) killedDueToMaxTimeMSExpired : Long("<num>"), // Added in MongoDB 7.2 (*Also available in 7.0.5*) numConnectionNetworkTimeouts : Long("<num>"), // Added in MongoDB 6.3 totalTimeWaitingBeforeConnectionTimeoutMillis : Long("<num>"), // Added in MongoDB 6.3 scanAndOrder : Long("<num>"), writeConflicts : Long("<num>") }, operatorCounters : { expressions : { <command> : Long("<num>") }, match : { <command> : Long("<num>") } }, query: { allowDiskUseFalse: Long("<num>"), updateOneOpStyleBroadcastWithExactIDCount: Long("<num>"), lookup: { hashLookup: Long("<num>"), hashLookupSpillToDisk: Long("<num>"), indexedLoopJoin: Long("<num>"), nestedLoopJoin: Long("<num>") }, multiPlanner: { classicCount: Long("<num>"), classicMicros: Long("<num>"), classicWorks: Long("<num>"), sbeCount: Long("<num>"), sbeMicros: Long("<num>"), sbeNumReads: Long("<num>"), histograms: { classicMicros: [ { lowerBound: Long("0"), count: Long("<num>") }, { < Additional histogram groups not shown. > }, { lowerBound: Long("1073741824"), count: Long("<num>")> }> ], classicNumPlans: [ { lowerBound: Long("0"), count: Long("<num>") }, { < Additional histogram groups not shown. > }, { lowerBound: Long("32"), count: Long("<num>") } ], classicWorks: [ { lowerBound: Long("0"), count: Long("<num>") }, { < Additional histogram groups not shown. > }, { lowerBound: Long("32768"), count: Long("<num>") } ], sbeMicros: [ { lowerBound: Long("0"), count: Long("<num>") }, { < Additional histogram groups not shown. > }, { lowerBound: Long("1073741824"), count: Long("<num>") } ], sbeNumPlans: [ { lowerBound: Long("0"), count: Long("<num>") }, { < Additional histogram groups not shown. > }, { lowerBound: Long("32"), count: Long("<num>") } ], sbeNumReads: [ { lowerBound: Long("0"), count: Long("<num>") }, { < Additional histogram groups not shown. > }, { lowerBound: Long("32768"), count: Long("<num>") } ] } }, planCache: { classic: { hits: Long("<num>"), misses: Long("<num>") }, sbe: { hits: Long("<num>"), misses: Long("<num>") }, classic: { hits: Long("<num>"), misses: Long("<num>"), replanned: Long("<num>") }, sbe: { hits: Long("<num>"), misses: Long("<num>"), replanned: Long("<num>") } }, queryFramework: { aggregate: { classicHybrid: Long("<num>"), classicOnly: Long("<num>"), cqf: Long("<num>"), sbeHybrid: Long("<num>"), sbeOnly: Long("<num>") }, find: { classic: Long("<num>"), cqf: Long("<num>"), sbe: Long("<num>") } } }, queryExecutor: { scanned : Long("<num>"), scannedObjects : Long("<num>"), collectionScans : { nonTailable : Long("<num>"), total : Long("<num>") }, profiler : { collectionScans : { nonTailable : Long("<num>"), tailable : Long("<num>"), total : Long("<num>") } } }, record : { moves : Long("<num>") }, repl : { executor : { pool : { inProgressCount : <num> }, queues : { networkInProgress : <num>, sleepers : <num> }, unsignaledEvents : <num>, shuttingDown : <boolean>, networkInterface : <string> }, apply : { attemptsToBecomeSecondary : Long("<num>"), batches : { num : <num>, totalMillis : <num> }, ops : Long("<num>") }, buffer : { count : Long("<num>"), maxSizeBytes : Long("<num>"), sizeBytes : Long("<num>") }, initialSync : { completed : Long("<num>"), failedAttempts : Long("<num>"), failures : Long("<num>") }, network : { bytes : Long("<num>"), getmores : { num : <num>, totalMillis : <num> }, notPrimaryLegacyUnacknowledgedWrites : Long("<num>"), notPrimaryUnacknowledgedWrites : Long("<num>"), oplogGetMoresProcessed : { num : <num>, totalMillis : <num> }, ops : Long("<num>"), readersCreated : Long("<num>"), replSetUpdatePosition : { num : Long("<num>") } }, reconfig : { numAutoReconfigsForRemovalOfNewlyAddedFields : Long("<num>") }, stateTransition : { lastStateTransition : <string>, userOperationsKilled : Long("<num>"), userOperationsRunning : Long("<num>") }, syncSource : { numSelections : Long("<num>"), numTimesChoseSame : Long("<num>"), numTimesChoseDifferent : Long("<num>"), numTimesCouldNotFind : Long("<num>") }, waiters : { opTime : Long("<num>"), replication : Long("<num>") } }, storage : { freelist : { search : { bucketExhausted : <num>, requests : <num>, scanned : <num> } } }, ttl : { deletedDocuments : Long("<num>"), passes : Long("<num>"), subPasses : Long("<num>") } }
metrics一个返回各种统计信息的文档,这些信息反映正在运行的
mongod实例的当前使用情况和状态。
metrics.abortExpiredTransactions.passes表示中止早于
transactionLifetimeLimitSeconds参数的事务的成功传递次数。如果
passes值停止递增,则表示abortExpiredTransactions线程可能被卡住。
metrics.abortExpiredTransactions.successfulKillsMongoDB成功结束的过期事务数量。
从会话池中签出会话以运行数据库操作。
AbortExpiredTransactionsSessionCheckoutTimeout设置尝试结束过期ACID 事务时要签出会话的最大毫秒数。If the expired transaction is successfully ended, MongoDB increments
metrics.abortExpiredTransactions.successfulKills. If the transaction isn't successfully ended because it timed out when attempting to check out a session, MongoDB incrementsmetrics.abortExpiredTransactions.timedOutKills.7.0.26版本新增。
metrics.abortExpiredTransactions.timedOutKillsMongoDB因尝试签出会话时超时而未能成功结束的过期事务数量。
从会话池中签出会话以运行数据库操作。
AbortExpiredTransactionsSessionCheckoutTimeout设置尝试结束过期ACID 事务时要签出会话的最大毫秒数。If the expired transaction is successfully ended, MongoDB increments
metrics.abortExpiredTransactions.successfulKills. If the transaction isn't successfully ended because it timed out when attempting to check out a session, MongoDB incrementsmetrics.abortExpiredTransactions.timedOutKills.7.0.26版本新增。
metrics.aggStageCountersA document that reports on the use of aggregation pipeline stages. The fields in
metrics.aggStageCountersare the names of aggregation pipeline stages. For each pipeline stage,serverStatusreports the number of times that stage has been executed.已在版本 5.2(以及 5.0.6)中更新。
metrics.apiVersions包含以下内容的文档:
每个客户端应用程序的名称
每个应用程序在过去 24 小时内配置的 Stable API 版本
查看
metrics.apiVersions时请考虑以下事项:每个
appname可能的返回值为:default:该命令是在未指定 Stable API 版本的情况下发出的。1:该命令是使用 Stable API 版本 1 发出的。
注意
可能会看到
appname的两个返回值,因为可以在命令级别指定 Stable API 版本。某些命令可能是在没有 Stable API 版本的情况下发出的,而其他命令则是在版本 1 下发出的。API 版本指标保留 24 小时。如果过去 24 小时内没有使用具体 API 版本从应用程序发出命令,则从指标中删除
appname和 API 版本。这也适用于defaultAPI 版本指标。连接至 MongoDB 实例时,通过在连接 URI 中指定
appname来设置appname。?appName=ZZZ将appname设置为ZZZZ。访问 Stable API 的驱动程序可以设置默认
appname。If no
appnameis configured, a default value is automatically populated based on the product. For example, for a MongoDB Compass connection with noappnamein the URI, the metric returns:'MongoDB Compass': [ 'default' ].
版本 5.0 中的新增功能。
metrics.operatorCounters一个文档,其中报告聚合管道操作符和表达式使用情况。
metrics.operatorCounters.expressions一个带有数字的文档,表示表达式的运行频率。
要获取特定操作符(例如大于操作符 (
$gt))的指标,请将该操作符附加到命令中:db.runCommand( { serverStatus: 1 } ).metrics.operatorCounters.expressions.$gt 版本 5.0 中的新增功能。
metrics.operatorCounters.match带有数字的文档,该数字指示匹配表达式运行的频率。
匹配表达式操作符也会作为聚合管道
$match的一部分递增。如果$match阶段使用$expr操作符,则$expr的计数器会递增,但组件计数器不会递增。考虑以下查询:
db.matchCount.aggregate( [ { $match: { $expr: { $gt: [ "$_id", 0 ] } } } ] ) 查询运行时,
$expr的计数器会递增。$gt的计数器不会递增。
metrics.changeStreams报告大于 16 MB 的变更流事件的相关信息的文档。
7.0版本新增。
metrics.changeStreams.largeEventsFailed由于事件大于 16 MB 而导致
BSONObjectTooLarge异常的变更流事件的数量。要防止出现异常,请参阅$changeStreamSplitLargeEvent。版本 7.0 新增内容:(也适用于版本 6.0.9 和 5.0.19)
metrics.changeStreams.largeEventsSplit分割成较小片段且大于 16 MB 的变更流事件的数量。仅当使用
$changeStreamSplitLargeEvent管道阶段时,才会分割事件。版本 7.0 中的新功能:(也适用于 6.0.9)
metrics.commandsA document that reports on the use of database commands. The fields in
metrics.commandsare the names of database commands. For each command, theserverStatusreports the total number of executions and the number of failed executions.metrics.commandsincludesreplSetStepDownWithForce(that is, thereplSetStepDowncommand withforce: true) as well as the overallreplSetStepDown. In earlier versions, the command reported only overallreplSetStepDownmetrics.
metrics.commands.<command>.failed<command>在此mongod上失败的次数。
metrics.commands.<create or collMod>.validator对于
create和collMod命令,它是报告传递给命令的非空validator对象的文档,用于指定集合的验证规则或表达式。
metrics.commands.<create or collMod>.validator.total将非空
validator对象作为选项传递给此mongod上的命令的次数。
metrics.commands.<create or collMod>.validator.failed由于模式验证错误,使用非空
validator对象调用此mongod上的命令失败的次数。
metrics.commands.<create or collMod>.validator.jsonSchema将带有
$jsonSchema的validator对象作为选项传递给此mongod上的命令的次数。
metrics.commands.<command>.total在此
mongod上执行<command>的次数。
metrics.commands.update.pipeline使用聚合管道更新此
mongod上的文档的次数。从更新总数中减去该值以获得使用文档事务语法进行的更新次数。pipeline计数器仅适用于update和findAndModify操作。
metrics.commands.findAndModify.pipeline聚合管道中使用
findAndModify()来更新此mongod上的文档的次数。pipeline计数器仅适用于update和findAndModify操作。
metrics.commands.update.arrayFilters使用 arrayFilter 更新此
mongod上的文档的次数。arrayFilters计数器仅适用于update和findAndModify操作。
metrics.commands.findAndModify.arrayFilters将 arrayFilter 与
findAndModify()一起使用来更新此mongod上的文档的次数。arrayFilters计数器仅适用于update和findAndModify操作。
metrics.documentA document that reflects document access and modification patterns. Compare these values to the data in the
opcountersdocument, which track total number of operations.
metrics.dotsAndDollarsFields带有数字的文档,该数字指示使用美元 (
$) 前缀名称执行插入或更新操作的频率。此值不报告确切的操作次数。当 upsert 操作创建一个新文档时,它将被视为
insert而不是update。版本 5.0 中的新增功能。
metrics.getLastError一个文档,其中报告写关注使用情况。
metrics.getLastError.wtime一个文档,其中报告
w参数大于1时的写关注操作计数。
metrics.getLastError.wtime.totalMillismongod执行特定写关注(write concern)操作所花费的总时间(以毫秒为单位),这些操作指定写关注(即w),并等待一个或多个副本集节点确认写操作(即w值大于1)。
metrics.getLastError.wtimeouts由于
wtimeout阈值导致写关注操作超时的次数。对于默认和非默认写关注规范,该数字都会递增。
metrics.getLastError.default一个文档,其中报告何时使用默认写关注(即非
clientSupplied写关注)。默认写关注的可能来源是:implicitDefaultcustomDefaultgetLastErrorDefaults
有关每种可能的写关注来源或
provenance的信息,请参阅下表:来源说明clientSupplied应用程序中指定了写关注。
customDefault写入关注源自自定义的默认值。请参阅
setDefaultRWConcern。getLastErrorDefaults写关注源自副本集的
settings.getLastErrorDefaults字段。implicitDefault在没有所有其他写入关注规范的情况下,写入关注源自服务器。
metrics.mongos包含有关
mongos的指标的文档。
metrics.mongos.cursor包含
mongos使用的游标指标的文档。
metrics.mongos.cursor.moreThanOneBatch自
mongos启动以来返回多个批处理的游标的总数。其他批处理可使用getMore命令进行检索。版本 5.0 中的新增功能。
metrics.mongos.cursor.totalOpenedThe total number of cursors that have been opened since
mongosstarted, including cursors currently open. Differs frommetrics.cursor.open.total, which is the number of currently open cursors only.版本 5.0 中的新增功能。
metrics.network.totalIngressTLSHandshakeTimeMillis6.3版本新增。
服务器的传入连接必须等待 TLS 网络握手完成的总时间(以毫秒为单位)。该数字为累积性,表示服务器启动后的总数。
metrics.network.totalTimeForEgressConnectionAcquiredToWireMicros6.3版本新增。
操作在获取服务器连接和写入字节以通过网络发送到服务器之间等待的总时间(以微秒为单位)。该数字为累积性,表示服务器启动后的总数。
metrics.network.totalTimeToFirstNonAuthCommandMillis6.3版本新增。
从接受传入服务器的连接到收到不属于连接身份验证握手的第一个操作的总时间(以毫秒为单位)。该数字为累积性,表示服务器启动后的总数。
metrics.operation.totalTimeWaitingBeforeConnectionTimeoutMillis6.3版本新增。
由于服务器连接获取超时错误而导致操作失败前的总等待时间(毫秒)。
metrics.query.lookup一个文档,提供有关使用基于时隙的查询执行引擎的
$lookup阶段的详细数据。要了解更多信息,请参阅$lookup优化。这些指标主要供 MongoDB 内部使用。
6.1 版本新增
metrics.query.multiPlanner为基于时隙的查询执行引擎和经典查询引擎提供详细的查询规划数据。有关基于时隙的查询执行引擎的更多信息,请参阅:基于时隙的查询执行引擎管道优化。
这些指标主要供 MongoDB 内部使用。
版本 6.0.0和 5.0.9中的新增内容
query.queryFramework.aggregate一个文档,其中报告在每个查询框架上运行的聚合操作数量。
query.queryFramework.aggregate中的子字段指示每个框架用于执行聚合操作的次数。
query.queryFramework.find一个文档,其中报告在每个查询框架上运行的查找操作数量。
query.queryFramework.find中的子字段指示每个框架用于执行查找操作的次数。
metrics.queryExecutor.scanned在查询和查询计划评估期间扫描的索引项目总数。该计数器与
explain()的输出中的totalKeysExamined相同。
metrics.queryExecutor.scannedObjects查询和查询计划评估期间扫描的文档总数。该计数器与
explain()的输出中的totalDocsExamined相同。
metrics.queryExecutor.collectionScans.nonTailable执行了集合扫描但未使用可追加游标的查询数量。
metrics.queryExecutor.collectionScans.total执行集合扫描的查询总数。该总数包括使用和未使用可追加游标的查询。
metrics.queryExecutor.profiler.collectionScans.total对
profile集合执行集合扫描的查询总数。这包括同时使用可追加和不可追加游标的查询。
metrics.replA document that reports metrics related to the replication process.
metrics.repldocument appears on allmongodinstances, even those that aren't members of replica sets.
metrics.repl.apply一个文档,其中报告复制 oplog 中操作的应用情况。
metrics.repl.apply.batchSizeThe total number of oplog entries applied. The
metrics.repl.apply.batchSizeis incremented with the number of oplog entries in a batch at the batch boundaries instead of being incremented by one after each entry.For finer granularity, see
metrics.repl.apply.ops.
metrics.repl.apply.batchesmetrics.repl.apply.batchesreports on the oplog application process on secondaries members of replica sets. See Multithreaded Replication for more information on the oplog application processes.
metrics.repl.apply.batches.totalMillismongod应用 oplog 中的操作所花费的总时间(以毫秒为单位)。
metrics.repl.apply.opsThe total number of operations applied during the replication process.
metrics.repl.apply.opsis incremented after each operation, including operations that derive from oplog entries during application, such as updates to internal metadata collections likeconfig.transactions.
metrics.repl.bufferMongoDB buffers oplog operations from the replication sync source buffer before applying oplog entries in a batch.
metrics.repl.bufferprovides a way to track the oplog buffer. See Multithreaded Replication for more information on the oplog application process.
metrics.repl.buffer.maxSizeBytes缓冲区的大小上限。该值是
mongod中的常量设置,不可配置。
metrics.repl.networkmetrics.repl.network报告复制过程的网络使用情况。
metrics.repl.network.bytesmetrics.repl.network.bytes报告从复制同步源读取的总数据量。
metrics.repl.network.getmoresmetrics.repl.network.getmoresreports on thegetmoreoperations, which are requests for additional results from the oplog cursor as part of the oplog replication process.
metrics.repl.network.getmores.nummetrics.repl.network.getmores.numreports the total number ofgetmoreoperations, which are operations that request an additional set of operations from the replication sync source.
metrics.repl.network.getmores.totalMillismetrics.repl.network.getmores.totalMillisreports the total amount of time required to collect data fromgetmoreoperations.注意
此数字可能很大,因为,即使
getmore操作没有初始返回数据,MongoDB 也会等待更多数据。
metrics.repl.network.getmores.numEmptyBatches从节点从同步源接收的空
oplog批处理的数量。如果从节点与源完全同步并且满足以下任一条件,则从节点会收到一个空批处理:getmore在等待更多数据时超时,或者自从最后一次批处理发送到该从节点以来,同步源的大部分提交点已提前。
对于主节点,如果该实例以前是从节点,则该数字报告其作为从节点时收到的空批处理数。否则,对于主节点,此数字为
0。
metrics.repl.network.oplogFetcherLagSeconds同步源的上次应用的optime与oplog获取器在此节点上获取的最高optime之间的复制获取延迟(以秒为单位)。
metrics.repl.network.oplogGetMoresProcessed.totalMillisThe time, in milliseconds, that a node spent processing the
getMorecommands counted inmetrics.repl.network.oplogGetMoresProcessed.num.
metrics.repl.network.readersCreated创建的oplog查询进程总数。每当连接发生错误时,包括超时或网络操作, MongoDB都会创建新的oplog查询。每当MongoDB选择新的复制源时,该值也会递增。
metrics.repl.network.replSetUpdatePosition.num节点发送到其同步源的
replSetUpdatePosition命令的数量。replSetUpdatePosition命令是内部复制命令,用于将复制进度从节点传送到其同步源。注意
处于
STARTUP2状态的副本集节点不会向其同步源发送replSetUpdatePosition命令。
metrics.repl.reconfig一个文档,其中包含节点的
newlyAdded字段被主节点自动删除的次数。当一个节点首次被添加到副本集时,该节点的newlyAdded字段将被设置为true。版本 5.0 中的新增功能。
metrics.repl.reconfig.numAutoReconfigsForRemovalOfNewlyAddedFields主节点自动删除的
newlyAdded节点字段的次数。当一个节点首次被添加到副本集时,该节点的newlyAdded字段将被设置为true。在主节点收到指示节点状态为SECONDARY、RECOVERING或ROLLBACK的节点心跳响应后,主节点将自动删除该节点的newlyAdded字段。newlyAdded字段存储在local.system.replset集合中。版本 5.0 中的新增功能。
metrics.repl.stateTransition.lastStateTransition报告的转换情况:
状态变更说明"stepUp"节点升级成为主节点。
"stepDown"节点降级成为从节点。
"rollback"节点正在主动执行回滚。
""节点未发生任何状态更改。
metrics.repl.stateTransition.userOperationsKilled在
mongod实例的状态变改期间停止的操作次数。注意
该指标反映被终止的操作总数,无论操作是由用户还是服务器发起。
metrics.repl.stateTransition.userOperationsRunning在
mongod实例的状态更改期间保持运行的操作数。注意
该指标反映正在运行的操作总数,无论操作是由用户还是服务器发起。
metrics.repl.syncSource有关副本集节点的同步源选择进程的信息。
metrics.repl.syncSource.numSelections节点尝试从可用同步源选项中选择节点进行同步的次数。例如,如果重新评估同步源或节点从当前同步源收到错误,则节点会尝试选择要从中进行同步的节点。
metrics.repl.waiters.replication等待复制或日志写关注确认的线程数量。
版本 7.0.10 中的新增功能:(也适用于 6.0.16 和 5.0.27)
metrics.repl.waiters.opTime排队等待本地复制 optime 分配的线程数。
版本 7.0.10 中的新增功能:(也适用于 6.0.16 和 5.0.27)
metrics.storage.freelist.search.bucketExhaustedmongod在没有发现大量记录分配的情况下检查空闲列表的次数。
metrics.storage.freelist.search.requestsmongod搜索可用记录分配的次数。
metrics.storage.freelist.search.scannedmongod搜索的可用记录分配的数量。
metrics.ttl一个文档,其中报告 ttl 索引进程的资源使用情况的操作信息。
metrics.ttl.deletedDocuments从具有 ttl 索引的集合中删除的文档总数。
metrics.ttl.passesTTL 背景进程为检查过期文档而执行的传递次数。当 TTL 监视器从所有 TTL 索引中删除了它能找到的尽可能多的候选文档时,一次通过即完成。有关 TTL 索引删除过程的更多信息,请参阅删除流程。
metrics.ttl.subPassesTTL 背景进程为检查过期文档而执行的子遍数。有关 TTL 索引删除过程的更多信息,请参阅删除流程。
metrics.cursor.moreThanOneBatch自服务器进程启动以来返回多个批处理的游标总数。使用
getMore命令可检索其他批处理。版本 5.0 中的新增功能。
metrics.cursor.totalOpenedThe total number of cursors that have been opened since the server process started, including cursors currently open. Differs from
metrics.cursor.open.total, which is the number of currently open cursors only.版本 5.0 中的新增功能。
metrics.cursor.lifespan一个文档,报告使用寿命位于指定时间段内的游标的数量。游标使用寿命是指从创建游标到使用
killCursors命令终止游标或游标在批处理中没有剩余对象时的时间段。使用寿命时间段为:
< 1 秒
>= 1 秒但 < 5 秒
>= 5 秒但 < 15 秒
>= 15 秒但 < 30 秒
>= 30 秒但 < 1 分钟
>= 1 分钟但 < 10 分钟
>= 10 分钟
版本 5.0 中的新增功能。
metrics.cursor.open.noTimeout打开游标的数量,设置了选项
DBQuery.Option.noTimeout,防止一段时间不活动后出现超时。
metrics.cursor.open.totalMongoDB 为客户端维护的游标数量。由于 MongoDB 会耗尽未使用的游标,因此该值通常很小或为零。但是,如果存在队列、过时的可追加游标或大量操作,则该值可能会增加。
metrics.cursor.open.singleTargetThe total number of cursors that only target a single shard. Only
mongosinstances reportmetrics.cursor.open.singleTargetvalues.
metrics.cursor.open.multiTargetThe total number of cursors that only target more than one shard. Only
mongosinstances reportmetrics.cursor.open.multiTargetvalues.
镜像读 (Mirrored Reads)
仅在 mongod 上可用。
"mirroredReads" : { "seen" : <num>, "sent" : <num> },
mirroredReads仅在 mongod 上可用。
A document that reports on mirrored reads. To return
mirroredReadsinformation, you must explicitly specify the inclusion:db.runCommand( { serverStatus: 1, mirroredReads: 1 } ) mirroredReads.processedAsSecondary6.2版本新增。
该节点作为从节点时处理的镜像读数量。
提示
mirrorReadsParameter
mirroredReads.seen该节点收到的支持镜像的操作的数量。
提示
mirrorReadsParameter
mirroredReads.sent该节点作为主节点时发送的镜像读数量。例如,如果读取被镜像并发送至两个从节点,则镜像读的数量为
2。提示
mirrorReadsParameter
网络
network : { bytesIn : Long("<num>"), bytesOut : Long("<num>"), physicalBytesIn : Long("<num>"), physicalBytesOut : Long("<num>"), numSlowDNSOperations : Long("<num>"), numSlowSSLOperations : Long("<num>"), numRequests : Long("<num>"), tcpFastOpen : { kernelSetting : Long("<num>"), serverSupported : <bool>, clientSupported : <bool>, accepted : Long("<num>") }, compression : { snappy : { compressor : { bytesIn : Long("<num>"), bytesOut : Long("<num>") }, decompressor : { bytesIn : Long("<num>"), bytesOut : Long("<num>") } }, zstd : { compressor : { bytesIn : Long("<num>"), bytesOut : Long("<num>") }, decompressor : { bytesIn : Long("<num>"), bytesOut : Long("<num>") } }, zlib : { compressor : { bytesIn : Long("<num>"), bytesOut : Long("<num>") }, decompressor : { bytesIn : Long("<num>"), bytesOut : Long("<num>") } } }, serviceExecutors : { passthrough : { threadsRunning : <num>, clientsInTotal : <num>, clientsRunning : <num>, clientsWaitingForData : <num> }, fixed : { threadsRunning : <num>, clientsInTotal : <num>, clientsRunning : <num>, clientsWaitingForData : <num> } }, listenerProcessingTime : { durationMicros : <num> } // Added in MongoDB 6.3 }
network报告 MongoDB 网络使用相关数据的文档。这些统计信息仅衡量入口连接,特别是
mongod或mongos通过客户端或其他mongod或mongos实例发起的网络连接看到的流量。由该mongod或mongos实例启动的网络连接(特别是出口连接)产生的流量值不 包含在这些统计信息中。
network.numRequestsThe total number of distinct requests that the server has received. Use this value to provide context for the
network.bytesInandnetwork.bytesOutvalues to ensure that MongoDB's network utilization is consistent with expectations and application use.
network.tcpFastOpen.kernelSetting仅 Linux
返回
/proc/sys/net/ipv4/tcp_fastopen的值:0- 系统已禁用 TCP 快速打开。1- 为传出连接启用 TCP 快速打开。2- 为传入连接启用 TCP 快速打开。3- 为传入和传出连接启用“TCP 快速打开”。
network.tcpFastOpen.serverSupported如果主机操作系统支持入站 TCP 快速打开 (TFO) 连接,则返回
true。如果主机操作系统不 支持入站 TCP 快速打开 (TFO) 连接,则返回
false。
network.tcpFastOpen.clientSupported如果主机操作系统支持出站 TCP 快速打开 (TFO) 连接,则返回
true。如果主机操作系统不支持出站 TCP 快速打开 (TFO) 连接,则返回
false。
network.compression.snappy一个文档,返回有关使用 snappy 库压缩和解压缩的字节数的统计信息。
network.compression.zstd一个文档,返回有关使用 zstd 库压缩和解压缩的字节数的统计信息。
network.compression.zlib一个文档,返回有关使用 zlib 库压缩和解压缩的字节数的统计信息。
network.serviceExecutors.passthrough版本 5.0 中的新增功能。
一个文档,报告有关
passthrough服务执行程序的线程和客户端的数据。passthrough服务执行程序为每个客户端创建一个新线程,并在客户端结束后销毁该线程。
network.serviceExecutors.passthrough.clientsInTotal版本 5.0 中的新增功能。
分配给
passthrough服务执行程序的客户端总数。可以将客户端分配给passthrough服务执行程序和当前未运行的请求。
network.serviceExecutors.passthrough.clientsWaitingForData版本 5.0 中的新增功能。
使用等待来自网络的传入数据的
passthrough服务执行程序的客户端数量。
network.serviceExecutors.fixed版本 5.0 中的新增功能。
一个文档,报告有关
fixed服务执行程序的线程和客户端的数据。fixed服务执行程序拥有固定数量的线程。线程被临时分配给客户端,并在客户端结束后予以保留。
network.serviceExecutors.fixed.clientsInTotal版本 5.0 中的新增功能。
分配给
fixed服务执行程序的客户端总数。可以将客户端分配给fixed服务执行程序和当前未运行的请求。
opLatencies
opLatencies : { reads : <document>, writes : <document>, commands : <document>, transactions : <document> },
opLatencies包含整个实例的操作延迟的文档。有关此文档的说明,请参阅latencyStats 文档。
从MongoDB6.2 开始, 和 实例的
opLatenciesmongodmongos指标报告。mongos报告的延迟包括操作延迟时间以及mongod和mongos实例之间的通信时间。Starting in MongoDB 7.0, each category document includes
queryableEncryptionLatencyMicros, the total latency, in microseconds, attributable to Queryable Encryption operations.
opReadConcernCounters
仅适用于 mongod 实例
opReadConcernCounters : { available : Long("<num>"), linearizable : Long("<num>"), local : Long("<num>"), majority : Long("<num>"), snapshot : Long("<num>"), none : Long("<num>") }
opReadConcernCounters已在版本5.0 中删除。已替换为
readConcernCounters。一个文档,其中报告自
mongod实例上次启动以来,查询操作为该实例指定的读关注级别。指定w说明"available"指定读关注级别
"available"的查询操作的数量。"linearizable"指定读关注级别
"linearizable"的查询操作的数量。"local"指定读关注级别
"local"的查询操作的数量。"majority"指定读关注级别
"majority"的查询操作的数量。"snapshot"指定读关注级别
"snapshot"的查询操作的数量。"none"未指定读关注级别而是使用默认读关注级别的查询操作数量。
The sum of the
opReadConcernCountersequalsopcounters.query.
opWriteConcernCounters
仅适用于 mongod 实例
opWriteConcernCounters : { insert : { wmajority : Long("<num>"), wnum : { <num> : Long("<num>"), ... }, wtag : { <tag1> : Long("<num>"), ... }, none : Long("<num>"), noneInfo : { CWWC : { wmajority : Long("<num>"), wnum : { <num> : Long("<num>"), ... }, wtag : { <tag1> : Long("<num>"), ... } }, implicitDefault : { wmajority : Long("<num>") wnum : { <num> : Long("<num>"), ... } } } }, update : { wmajority : Long("<num>"), wnum : { <num> : Long("<num>"), ... }, wtag : { <tag1> : Long("<num>"), ... }, none : Long("<num>"), noneInfo : { CWWC : { wmajority : Long("<num>"), wnum : { <num> : Long("<num>"), ... } wtag : { <tag1> : Long("<num>"), ... } }, implicitDefault : { wmajority : Long("<num>") wnum : { <num> : Long("<num>"), ... } } } }, delete : { wmajority : Long("<num>") wnum : { <num> : Long("<num>"), ... }, wtag : { <tag1> : Long("<num>"), ... }, none : Long("<num>"), noneInfo : { CWWC : { wmajority : Long("<num>"), wnum : { <num> : Long("<num>"), ... }, wtag : { <tag1> : Long("<num>"), ... } }, implicitDefault : { wmajority : Long("<num>") wnum : { <num> : Long("<num>"), ... } } } } }
opWriteConcernCounters一个文档,其中报告自
mongod实例上次启动以来,写入操作为该实例指定的写关注。More specifically, the
opWriteConcernCountersreports on the w: <value> specified by the write operations. The journal flag option (j) and the timeout option (wtimeout) of the write concerns does not affect the count. The count is incremented even if the operation times out.注意
仅当
reportOpWriteConcernCountersInServerStatus参数设置为true(默认为false)时才可用。
opWriteConcernCounters.insert一个文档,其中报告自
mongod实例上次启动以来,插入操作为该实例指定的 w: <value>:注意
仅当
reportOpWriteConcernCountersInServerStatus参数设置为true(默认为false)时才可用。insert : { wmajority : Long("<num>"), wnum : { <num> : Long("<num>"), ... }, wtag : { <tag1> : Long("<num>"), ... }, none : Long("<num>"), noneInfo : { CWWC : { wmajority : Long("<num>"), wnum : {}, wtag : {} }, implicitDefault : { wmajority : Long("<num>") wnum : {} } } }, 指定w说明"wmajority"指定
w: "majority"的插入操作次数。"wnum"指定
w: <num>的插入操作次数。计数按特定的 ``<num>`` 进行分组。"wtag"指定
w: <tag>的插入操作次数。计数按特定<tag>分组。"none"未指定
w值的插入操作数。这些操作使用默认的w值 “majority”。"noneInfo"使用默认写关注的非事务查询操作的数量。这些指标跟踪
cluster wide write concern(全局默认写关注)和隐式默认写关注的使用情况。opWriteConcernCounters.noneInfo中的值之和应等于opWriteConcernCounters.none的值。The sum of the
opWriteConcernCounters.insertequalsopcounters.insert.
opWriteConcernCounters.update一个文档,其中报告自
mongod实例上次启动以来,更新操作为该实例指定的 w: <value>:注意
仅当
reportOpWriteConcernCountersInServerStatus参数设置为true(默认为false)时才可用。update : { wmajority : Long("<num>"), wnum : { <num> : Long("<num>"), ... }, wtag : { <tag1> : Long("<num>"), ... }, none : Long("<num>"), noneInfo : { CWWC : { wmajority : Long("<num>"), wnum : {}, wtag : {} }, implicitDefault : { wmajority : Long("<num>") wnum : {} } } }, 指定w说明"wmajority"指定
w: "majority"的更新操作数。"wnum"指定
w: <num>的更新操作数。计数按特定<num>分组。"wtag"指定
w: <tag>的更新操作数。计数按特定<tag>分组。"none"未指定
w值的更新操作数。这些操作使用1的默认值w。"noneInfo"使用默认写关注的非事务查询操作的数量。这些指标跟踪
cluster wide write concern(全局默认写关注)和隐式默认写关注的使用情况。opWriteConcernCounters.noneInfo中的值之和应等于opWriteConcernCounters.none的值。The sum of the
opWriteConcernCounters.updateequalsopcounters.update.
opWriteConcernCounters.delete一个文档,其中报告自
mongod实例上次启动以来,删除操作为该实例指定的 w: <value>:注意
仅当
reportOpWriteConcernCountersInServerStatus参数设置为true(默认为false)时才可用。delete : { wmajority : Long("<num>"), wnum : { <num> : Long("<num>"), ... }, wtag : { <tag1> : Long("<num>"), ... }, none : Long("<num>"), noneInfo : { CWWC : { wmajority : Long("<num>"), wnum : {}, wtag : {} }, implicitDefault : { wmajority : Long("<num>") wnum : {} } } } 指定w说明"wmajority"指定
w: "majority"的删除操作数量。"wnum"指定
w: <num>的删除操作数量。计数按特定<num>分组。"wtag"指定
w: <tag>的删除操作数量。计数按特定<tag>分组。"none"未指定
w值的删除操作数量。这些操作使用1的默认值w。"noneInfo"使用默认写关注的非事务查询操作的数量。这些指标跟踪
cluster wide write concern(全局默认写关注)和隐式默认写关注的使用情况。opWriteConcernCounters.noneInfo中的值之和应等于opWriteConcernCounters.none的值。The sum of the
opWriteConcernCounters.deleteequalsopcounters.delete.
运算计数器
opcounters : { insert : Long("<num>"), query : Long("<num>"), update : Long("<num>"), delete : Long("<num>"), getmore : Long("<num>"), command : Long("<num>"), },
opcounters一个文档,其中按类型报告自
mongod实例上次启动以来的数据库操作。这些数字将随着时间的推移而增长,直到下一次重新启动。随时间推移分析这些值,跟踪数据库的使用情况。
注意
The data in
opcounterstreats operations that affect multiple documents, such as bulk insert or multi-update operations, as a single operation. Seemetrics.documentfor more granular document-level operation tracking.此外,这些值还反映接收到的操作,即使操作不成功,也会递增。
opcounters.insert自
mongod实例上次启动以来收到的插入操作总数。
opcounters.query自
mongod实例上次启动以来收到的查询总数。从 MongoDB 7.1 开始,聚合算作查询操作,并递增该值。
opcounters.update自
mongod实例上次启动以来收到的更新操作总数。
opcounters.delete自
mongod实例上次启动以来的删除操作总数。
opcounters.command自
mongod实例上次启动以来向数据库发出的命令总数。opcounters.commandcounts all commands except the following:
opcountersRepl
返回的 opcountersRepl。*值的类型为 NumberLong。
opcountersRepl : { insert : Long("<num>"), query : Long("<num>"), update : Long("<num>"), delete : Long("<num>"), getmore : Long("<num>"), command : Long("<num>"), },
opcountersRepl一个文档,其中按类型报告自
mongod实例上次启动以来的数据库复制操作。这些值只有在当前主机是副本集成员时才会出现。
These values differ from the
opcountersvalues because of how MongoDB serializes operations during replication. See Replication for more information on replication.这些数字会随着时间的推移和数据库的使用而增长,直到下一个重启。随时分析这些值,以追踪数据库的使用情况。
返回的 opcountersRepl。*值的类型为 NumberLong。
opcountersRepl.insert自
mongod实例上次启动以来复制的插入操作总数。返回的 opcountersRepl。*值的类型为 NumberLong。
opcountersRepl.query自
mongod实例上次启动以来复制的查询总数。返回的 opcountersRepl。*值的类型为 NumberLong。
opcountersRepl.update自
mongod实例上次启动以来复制的更新操作总数。返回的 opcountersRepl。*值的类型为 NumberLong。
opcountersRepl.delete自
mongod实例上次启动以来复制的删除操作总数。返回的 opcountersRepl。*值的类型为 NumberLong。
opcountersRepl.getmore自
mongod实例上次启动以来getMore操作的总数。即使查询计数较低,此计数器读数也可能很高。从节点发送getMore操作,作为复制进程的一部分。返回的 opcountersRepl。*值的类型为 NumberLong。
opcountersRepl.command自
mongod实例上次启动以来向数据库发出的已复制命令总数。返回的 opcountersRepl。*值的类型为 NumberLong。
oplogTruncation
oplogTruncation : { totalTimeProcessingMicros : Long("<num>"), processingMethod : <string>, oplogMinRetentionHours : <double> totalTimeTruncatingMicros : Long("<num>"), truncateCount : Long("<num>") },
oplogTruncation一个文档,其中报告 oplog 截断情况。
该字段仅在当前实例是副本集节点并且使用 WiredTiger 存储引擎或适用于自管理部署的内存存储引擎时出现。
可用于 WiredTiger 存储引擎。
oplogTruncation.totalTimeProcessingMicros扫描或采样 oplog 以确定 oplog 截断点所用的总时间(以微秒为单位)。
totalTimeProcessingMicrosis only meaningful if themongodinstance started on existing data files (that is, not meaningful for In-Memory Storage Engine for Self-Managed Deployments).看
oplogTruncation.processingMethod可用于 WiredTiger 存储引擎。
oplogTruncation.processingMethod启动时用于确定 oplog 截断点的方法。该值可以是
"sampling"或"scanning"。processingMethodis only meaningful if themongodinstance started on existing data files (that is, not meaningful for In-Memory Storage Engine for Self-Managed Deployments).可用于 WiredTiger 存储引擎。
oplogTruncation.oplogMinRetentionHoursOplog 的最短保留期(以小时为单位)。如果 oplog 已超过 oplog 大小,则
mongod仅截断早于已配置保留值的 oplog 条目。仅当
mongod是副本集的节点且 满足以下条件时才可见:mongod是使用--oplogMinRetentionHours命令行选项或storage.oplogMinRetentionHours配置文件选项启动的,or
最短保留期是在启动后使用
replSetResizeOplog配置的。
oplogTruncation.totalTimeTruncatingMicros执行 oplog 截断所花费的累积时间,以微秒为单位。
可用于 WiredTiger 存储引擎。
oplogTruncation.truncateCountoplog 截断的累积次数。
可用于 WiredTiger 存储引擎。
planCache
7.0版本新增。
planCache : { totalQueryShapes : Long("<num>"), totalSizeEstimateBytes : Long("<num>"), classic : { hits : Long("<num>"), misses : Long("<num>"), replanned : Long("<num>") }, sbe : { hits : Long("<num>"), misses: Long("<num>"), replanned : Long("<num>") } }
planCache.totalQueryShapes查询形状的大致数量。
在版本 7.2 之前,有关查询形状数量的信息存储在
query.planCacheTotalQueryShapes字段中。版本 7.2 中的新功能:(也适用于 7.0.5)
分析器
profiler: { totalWrites: <integer>, activeWriters: <integer> }
profiler.totalWrites对所有数据库上的
profile集合的写入总数。
queryStats
版本 7.0.12 中的新增功能:(也可从 6.0.7 开始使用)
queryStats: { numEvicted: Long("<num>"), numRateLimitedRequests: Long("<num>"), queryStatsStoreSizeEstimateBytes: Long("<num>"), numQueryStatsStoreWriteErrors: Long("<num>"), numHmacApplicationErrors: Long("<num>") },
queryStats包含
$queryStats聚合阶段指标的文档。
queryAnalyzers
7.0版本新增。
queryAnalyzers: { activeCollections: <integer>, totalCollections: <integer>, totalSampledReadsCount: <integer>, totalSampledWritesCount: <integer>, totalSampledReadsBytes: <integer>, totalSampledWritesBytes: <integer> }
queryAnalyzers.activeCollections查询分析器主动采样的集合数量。
readConcernCounters
版本 5.0 中的新增功能。
readConcernCounters : { nonTransactionOps : { none : Long("<num>"), noneInfo : { CWRC : { local : Long("<num>"), available : Long("<num>"), majority : Long("<num>") }, implicitDefault : { local : Long("<num>"), available : Long("<num>") } }, local : Long("<num>"), available : Long("<num>"), majority : Long("<num>"), snapshot : { withClusterTime : Long("<num>"), withoutClusterTime : Long("<num>") }, linearizable : Long("<num>") }, transactionOps : { none : Long("<num>"), noneInfo : { CWRC : { local : Long("<num>"), available : Long("<num>"), majority : Long("<num>") }, implicitDefault : { local : Long("<num>"), available : Long("<num>") } }, local : Long("<num>"), majority : Long("<num>"), snapshot : { withClusterTime : Long("<num>"), withoutClusterTime : Long("<num>") } } },
readConcernCountersA document that reports on the read concern level specified by query operations. This document contains the
readConcernCounters.nonTransactionOpsandreadConcernCounters.transactionOpsdocuments.
readConcernCounters.nonTransactionOps一个文档,其中报告数据库服务器上次启动后执行的非事务查询操作所指定的读关注级别。
readConcernCounters.nonTransactionOps.none未指定读关注级别而使用以下任一选项的非事务查询操作数量:
默认的读关注级别,或
全局默认读取会关注配置(如果由
setDefaultRWConcern命令设置)。
readConcernCounters.nonTransactionOps.noneInfo使用全局默认读关注和隐式默认读关注的非事务查询操作的数量。
readConcernCounters.nonTransactionOps.noneInfo中的值之和应等于readConcernCounters.nonTransactionOps.none的值。
readConcernCounters.nonTransactionOps.local指定
"local"读关注级别的非事务查询操作的数量。
readConcernCounters.nonTransactionOps.available指定
"available"读关注级别的非事务查询操作的数量。
readConcernCounters.nonTransactionOps.majority指定
"majority"读关注级别的非事务查询操作的数量。
readConcernCounters.nonTransactionOps.snapshot包含指定
"snapshot"读关注级别的非事务查询操作的文档。
readConcernCounters.nonTransactionOps.snapshot.withClusterTime指定
"snapshot"读关注级别和集群时间(指定时间点)的非事务查询操作数。
readConcernCounters.nonTransactionOps.snapshot.withoutClusterTime指定
"snapshot"读关注级别但没有集群时间的非事务查询操作数,这意味着省略了某个时间点,服务器将读取该节点可用的最近提交的快照。
readConcernCounters.nonTransactionOps.linearizable指定
"linearizable"读关注级别的非事务查询操作的数量。
readConcernCounters.transactionOps一个文档,其中报告数据库服务器上次启动后执行的事务查询操作所指定的读关注级别。
readConcernCounters.transactionOps.none满足以下条件的事务查询操作数:未指定读关注级别而是使用默认读关注级别或借助
setDefaultRWConcern命令添加的全局默认读关注或写关注配置。
readConcernCounters.transactionOps.local指定
"local"读关注级别的事务查询操作数。
readConcernCounters.transactionOps.available指定
"available"读关注级别的事务查询操作数。
readConcernCounters.transactionOps.majority指定
"majority"读关注级别的事务查询操作数。
readConcernCounters.transactionOps.snapshot包含指定
"snapshot"读关注级别的事务查询操作的文档。
readConcernCounters.transactionOps.snapshot.withClusterTime指定
"snapshot"读关注级别和集群时间(指定时间点)的事务查询操作数。
readConcernCounters.transactionOps.snapshot.withoutClusterTime指定
"snapshot"读关注级别但没有集群时间的事务查询操作数,这意味着省略了某个时间点,服务器将读取该节点可用的最近提交的快照。
readPreferenceCounters
从 MongoDB 7.0.3 开始提供(和 6.0.11)。
仅在 mongod 上可用。
readPreferenceCounters : { executedOnPrimary : { primary : { internal : Long("<num>"), external : Long("<num>") }, primaryPreferred : { internal : Long("<num>"), external : Long("<num>") }, secondary : { internal : Long("<num>"), external : Long("<num>") }, secondaryPreferred : { internal : Long("<num>"), external : Long("<num>") }, nearest : { internal : Long("<num>"), external : Long("<num>") }, tagged : { internal : Long("<num>"), external : Long("<num>") } }, executedOnSecondary : { primary : { internal : Long("<num>"), external : Long("<num>") }, primaryPreferred : { internal : Long("<num>"), external : Long("<num>") }, secondary : { internal : Long("<num>"), external : Long("<num>") }, secondaryPreferred : { internal : Long("<num>"), external : Long("<num>") }, nearest : { internal : Long("<num>"), external : Long("<num>") }, tagged : { internal : Long("<num>"), external : Long("<num>") } } }
repl
repl : { hosts : [ <string>, <string>, <string> ], setName : <string>, setVersion : <num>, isWritablePrimary : <boolean>, secondary : <boolean>, primary : <hostname>, me : <hostname>, electionId : ObjectId(""), primaryOnlyServices: { ReshardingRecipientService: { state: <string>, numInstances: <num> }, RenameCollectionParticipantService: { state: <string>, numInstances: <num> }, ShardingDDLCoordinator: { state: <string>, numInstances: <num> }, ReshardingDonorService: { state: <string>, numInstances: <num> } }, rbid : <num>, replicationProgress : [ { rid : <ObjectId>, optime : { ts: <timestamp>, term: <num> }, host : <hostname>, memberId : <num> }, ... ] }
replA document that reports on the replica set configuration.
replonly appear when the current host is a replica set. See Replication for more information on replication.
repl.setName一个体现当前副本集名称的字符串。该值反映了
--replSet命令行参数或配置文件中的replSetName值。
repl.isWritablePrimary一个布尔值,指示当前节点是否为副本集的主节点。
repl.secondary一个布尔值,指示当前节点是否为副本集的从节点。
repl.primary副本集当前主节点的主机名和端口信息 (
"host:port")。
repl.primaryOnlyServices包含服务器上每个活动主服务实例的数量和状态的文档。主服务只能在服务器为主服务器时启动,但可以在服务器更改状态后继续运行直至完成。
版本 5.0 中的新增功能。
repl.primaryOnlyServices.ReshardingRecipientService包含
ReshardingRecipientService的状态和实例数量的文档:由分片接收,根据新的分片键和区域,分片会在重新分片操作后拥有数据块。
重新分片协调节点指示每个发送和接收分片主节点,以重命名临时分片集合。临时集合将成为新的重新分片集合。
版本 5.0 中的新增功能。
repl.primaryOnlyServices.RenameCollectionParticipantService包含
RenameCollectionParticipantService的状态和实例数量的文档:RenameCollectionParticipantService确保在某个分片收到 renameCollection 请求后,该分片能够在系统出现故障的情况下恢复本地重命名。版本 5.0 中的新增功能。
repl.primaryOnlyServices.ShardingDDLCoordinator包含
ShardingDDLCoordinator的状态和实例数量的文档:ShardingDDLCoordinator服务管理主节点数据库的 DDL 操作,例如:创建数据库、删除数据库、renameCollection。ShardingDDLCoordinator确保在分片集群内的任何一个特定时间点,对每个数据库都执行一次 (DDL) 操作。版本 5.0 中的新增功能。
repl.primaryOnlyServices.ReshardingDonorService包含
ReshardingDonorService的状态和实例数量的文档:捐赠者是在重命名操作完成之前拥有分片集合数据段的分片。
重新分片协调节点指示每个发送和接收分片主节点,以重命名临时分片集合。临时集合将成为新的重新分片集合。
版本 5.0 中的新增功能。
repl.replicationProgress数组,其中副本集的每个成员都有一个文档,用于向该成员报告复制进程。通常,这是主节点,如果使用链式复制,则为从节点。
To include this output, you must pass the
reploption to theserverStatus, as in the following:db.serverStatus({ "repl": 1 }) db.runCommand({ "serverStatus": 1, "repl": 1 }) The content of the
repl.replicationProgresssection depends on the source of each member's replication. This section supports internal operation and is for internal and diagnostic use only.
repl.replicationProgress[n].optime该节点报告的有关该节点应用 oplog 中最后一次操作的信息。
安全性
security : { authentication : { saslSupportedMechsReceived : <num>, mechanisms : { MONGODB-X509 : { speculativeAuthenticate : { received : Long("<num>"), successful : Long("<num>") }, authenticate : { received : Long("<num>"), successful : Long("<num>") } }, SCRAM-SHA-1 : { speculativeAuthenticate : { received : Long("<num>"), successful : Long("<num>") }, authenticate : { received : Long("<num>"), successful : Long("<num>") } }, SCRAM-SHA-256 : { speculativeAuthenticate : { received : Long("<num>"), successful : Long("<num>") }, authenticate : { received : Long("<num>"), successful : Long("<num>") } } } }, SSLServerSubjectName: <string>, SSLServerHasCertificateAuthority: <boolean>, SSLServerCertificateExpirationDate: <date> },
security一个文档,其中报告:
security.authentication.saslSupportedMechsReceived版本 5.0 中的新增功能。
hello请求包含有效hello.saslSupportedMechs字段的次数。
security.authentication.mechanisms一个文档,其中报告使用给定身份验证机制对
mongod或mongos实例进行身份验证的次数。文档中的值区分标准身份验证和推测性身份验证。[1]注意
mechanisms文档中的字段取决于authenticationMechanisms参数的配置。mechanisms文档包含mongod或mongos实例支持的每种身份验证机制的字段。以下示例显示了仅支持X.509身份验证的部署的
mechanisms文档的形状。
security.authentication.mechanisms.MONGODB-X509一个文档,其中报告使用 X.509 对
mongod或mongos实例进行身份验证的次数。包括
X.509身份验证尝试总次数以及推测性尝试子集。[1]
security.authentication.mechanisms.MONGODB-X509.speculativeAuthenticate.successful使用 X.509 成功收到的推测性身份验证尝试次数。[1]
security.authentication.mechanisms.MONGODB-X509.authenticate.received使用 X.509 收到的成功和失败的身份验证尝试次数。此值包括使用 X.509 收到的推测性身份验证尝试。
security.authentication.mechanisms.MONGODB-X509.authenticate.successful使用 x.508 收到的成功身份验证尝试次数。此值包括使用 X.509 的成功推测性身份验证尝试。
[1] (1, 2, 3, 4) 推测性身份验证可最大限度地减少身份验证过程中的网络往返次数,从而优化性能。
分片
{ configsvrConnectionString : 'csRS/cfg1.example.net:27019,cfg2.example.net:27019,cfg2.example.net:27019', lastSeenConfigServerOpTime : { ts : <timestamp>, t : Long("<num>") }, maxChunkSizeInBytes : Long("<num>") }
shardingA document with data regarding the sharded cluster. The
lastSeenConfigServerOpTimeis present only for amongosor a shard member, not for a config server.
sharding.lastSeenConfigServerOpTimemongos或分片节点已看到的 CSRS 主节点的最新 optime。optime 文档包括:The
lastSeenConfigServerOpTimeis present only if the sharded cluster uses CSRS.
sharding.maxChunkSizeInBytesThe maximum size limit for a range to migrate. If this value has been updated recently on the config server, the
maxChunkSizeInBytesmay not reflect the most recent value.
shardingStatistics
在分片的成员上运行时:
shardingStatistics : { countStaleConfigErrors : Long("<num>"), countDonorMoveChunkStarted : Long("<num>"), countDonorMoveChunkCommitted : Long("<num>"), countDonorMoveChunkAborted : Long("<num>"), totalDonorMoveChunkTimeMillis : Long("<num>"), totalDonorChunkCloneTimeMillis : Long("<num>"), totalCriticalSectionCommitTimeMillis : Long("<num>"), totalCriticalSectionTimeMillis : Long("<num>"), countDocsClonedOnRecipient : Long("<num>"), countBytesClonedOnRecipient : Long("<num>"), countDocsClonedOnCatchUpOnRecipient : Long("<num>"), countBytesClonedOnCatchUpOnRecipient : Long("<num>"), countDocsClonedOnDonor : Long("<num>"), countRecipientMoveChunkStarted : Long("<num>"), countDocsDeletedByRangeDeleter : Long("<num>"), countDonorMoveChunkLockTimeout : Long("<num>"), unfinishedMigrationFromPreviousPrimary : Long("<num>"), chunkMigrationConcurrency : Long("<num>"), unauthorizedDirectShardOps : Long("<num>"), catalogCache : { numDatabaseEntries : Long("<num>"), numCollectionEntries : Long("<num>"), countStaleConfigErrors : Long("<num>"), totalRefreshWaitTimeMicros : Long("<num>"), numActiveIncrementalRefreshes : Long("<num>"), countIncrementalRefreshesStarted : Long("<num>"), numActiveFullRefreshes : Long("<num>"), countFullRefreshesStarted : Long("<num>"), countFailedRefreshes : Long("<num>") }, rangeDeleterTasks : <num>, resharding : { countStarted : Long("1"), countSucceeded : Long("1"), countFailed : Long("0"), countCanceled : Long("0"), lastOpEndingChunkImbalance : Long("0"), active : { documentsCopied : Long("0"), bytesCopied : Long("0"), countWritesToStashCollections : Long("0"), countWritesDuringCriticalSection : Long("0"), countReadsDuringCriticalSection : Long("0"), oplogEntriesFetched : Long("0"), oplogEntriesApplied : Long("0"), insertsApplied : Long("0"), updatesApplied : Long("0"), deletesApplied : Long("0") }, oldestActive : { coordinatorAllShardsHighestRemainingOperationTimeEstimatedMillis : Long("0"), coordinatorAllShardsLowestRemainingOperationTimeEstimatedMillis : Long("0"), recipientRemainingOperationTimeEstimatedMillis : Long("0") }, latencies : { collectionCloningTotalRemoteBatchRetrievalTimeMillis : Long("0"), collectionCloningTotalRemoteBatchesRetrieved : Long("0"), collectionCloningTotalLocalInsertTimeMillis : Long("0"), collectionCloningTotalLocalInserts : Long("0"), oplogFetchingTotalRemoteBatchRetrievalTimeMillis : Long("0"), oplogFetchingTotalRemoteBatchesRetrieved : Long("0"), oplogFetchingTotalLocalInsertTimeMillis : Long("0"), oplogFetchingTotalLocalInserts : Long("0"), oplogApplyingTotalLocalBatchRetrievalTimeMillis : Long("0"), oplogApplyingTotalLocalBatchesRetrieved : Long("0"), oplogApplyingTotalLocalBatchApplyTimeMillis : Long("0"), oplogApplyingTotalLocalBatchesApplied : Long("0") }, currentInSteps : { countInstancesInCoordinatorState1Initializing : Long("0"), countInstancesInCoordinatorState2PreparingToDonate : Long("0"), countInstancesInCoordinatorState3Cloning : Long("0"), countInstancesInCoordinatorState4Applying : Long("0"), countInstancesInCoordinatorState5BlockingWrites : Long("0"), countInstancesInCoordinatorState6Aborting : Long("0"), countInstancesInCoordinatorState7Committing : Long("-1"), countInstancesInRecipientState1AwaitingFetchTimestamp : Long("0"), countInstancesInRecipientState2CreatingCollection : Long("0"), countInstancesInRecipientState3Cloning : Long("0"), countInstancesInRecipientState4Applying : Long("0"), countInstancesInRecipientState5Error : Long("0"), countInstancesInRecipientState6StrictConsistency : Long("0"), countInstancesInRecipientState7Done : Long("0"), countInstancesInDonorState1PreparingToDonate : Long("0"), countInstancesInDonorState2DonatingInitialData : Long("0"), countInstancesInDonorState3DonatingOplogEntries : Long("0"), countInstancesInDonorState4PreparingToBlockWrites : Long("0"), countInstancesInDonorState5Error : Long("0"), countInstancesInDonorState6BlockingWrites : Long("0"), countInstancesInDonorState7Done : Long("0") } } } },
shardingStatistics : { numHostsTargeted: { find : { allShards: Long("<num>"), manyShards: Long("<num>"), oneShard: Long("<num>"), unsharded: Long("<num>") }, insert: { allShards: Long("<num>"), manyShards: Long("<num>"), oneShard: Long("<num>"), unsharded: Long("<num>") }, update: { allShards: Long("<num>"), manyShards: Long("<num>"), oneShard: Long("<num>"), unsharded: Long("<num>") }, delete: { allShards: Long("<num>"), manyShards: Long("<num>"), oneShard: Long("<num>"), unsharded: Long("<num>") }, aggregate: { allShards: Long("<num>"), manyShards: Long("<num>"), oneShard: Long("<num>"), unsharded: Long("<num>") } } }, catalogCache : { numDatabaseEntries : Long("<num>"), numCollectionEntries : Long("<num>"), countStaleConfigErrors : Long("<num>"), totalRefreshWaitTimeMicros : Long("<num>"), numActiveIncrementalRefreshes : Long("<num>"), countIncrementalRefreshesStarted : Long("<num>"), numActiveFullRefreshes : Long("<num>"), countFullRefreshesStarted : Long("<num>"), countFailedRefreshes : Long("<num>") } }
shardingStatistics : { numShardedCollections : Long("<num>") }
shardingStatistics.countStaleConfigErrors线程遇到过时配置异常的总次数。由于过时配置异常会触发元数据刷新,因此该数字大致与元数据刷新次数成正比。
仅当在分片上运行时才出现。
shardingStatistics.countDonorMoveChunkStarted作为范围迁移过程的一部分,MongoDB 在分片的主节点上启动
moveChunk命令或moveRange命令的总次数。这个不断增加的次数不考虑数据块迁移是否成功。仅当在分片上运行时才出现。
shardingStatistics.countDonorMoveChunkCommittedMongoDB 在分片主节点上提交的数据段迁移总数。
数据段迁移由
moveChunk和moveRange命令在范围迁移过程中执行。仅在分片上可用。
从 MongoDB 7.0(以及 6.3.2、6.0.6 和 5.0.18 版本)开始可用。
shardingStatistics.countDonorMoveChunkAbortedMongoDB 在分片主节点上中止的数据段迁移总数。
数据段迁移由
moveChunk和moveRange命令在范围迁移过程中执行。仅在分片上可用。
从 MongoDB 7.0(以及 6.3.2、6.0.6 和 5.0.18 版本)开始可用。
shardingStatistics.totalDonorMoveChunkTimeMillis将数据段从当前分片移动到其他分片的累计时间(毫秒)。对于每个数据段迁移,时间从
moveRange或moveChunk命令启动时开始,在范围迁移过程中将数据段移至其他分片时结束。仅在分片上可用。
从 MongoDB 7.0(以及 6.3.2、6.0.6 和 5.0.18 版本)开始可用。
shardingStatistics.totalDonorChunkCloneTimeMillis范围迁移过程的克隆阶段在分片主节点上所花费的累计时间(毫秒)。具体而言,对于此分片上的每次迁移,跟踪的时间从
moveRange和moveChunk命令开始,在目标分片进入catchup阶段以应用范围迁移过程中发生的更改之前结束。仅当在分片上运行时才出现。
shardingStatistics.totalCriticalSectionCommitTimeMillis范围迁移过程的更新元数据阶段在分片主节点上所花费的累计时间(毫秒)。在更新元数据阶段,MongoDB 会阻止对集合的所有操作。
仅当在分片上运行时才出现。
shardingStatistics.totalCriticalSectionTimeMillis范围迁移过程的追赶阶段和更新元数据阶段在分片主节点上花费的累计时间(毫秒)。
To calculate the duration of the catch-up phase, subtract
totalCriticalSectionCommitTimeMillisfromtotalCriticalSectionTimeMillis:totalCriticalSectionTimeMillis - totalCriticalSectionCommitTimeMillis 仅当在分片上运行时才出现。
shardingStatistics.countBytesClonedOnRecipient在范围迁移过程中,MongoDB 在接收分片的主节点上克隆的累计字节数。
有关数据同步的详细信息,请参阅副本集数据同步。
仅在分片上可用。
从 MongoDB 7.0(以及 6.3.2、6.0.6 和 5.0.18 版本)开始可用。
shardingStatistics.countDocsClonedOnCatchUpOnRecipient在范围迁移过程的追赶阶段,MongoDB 在接收分片主节点上克隆的累计文档数。
有关数据同步的详细信息,请参阅副本集数据同步。
仅在分片上可用。
从 MongoDB 7.0(以及 6.3.2、6.0.6 和 5.0.18 版本)开始可用。
shardingStatistics.countBytesClonedOnCatchUpOnRecipient在范围迁移过程的追赶阶段,MongoDB 在接收分片主节点上克隆的累计字节数。
有关数据同步的详细信息,请参阅副本集数据同步。
仅在分片上可用。
从 MongoDB 7.0(以及 6.3.2、6.0.6 和 5.0.18 版本)开始可用。
shardingStatistics.countRecipientMoveChunkStarted此成员作为接收分片的主分片,已开始接收的数据段的累计数量(无论移动是否成功),该计数会持续增加。
仅当在分片上运行时才出现。
shardingStatistics.countDocsDeletedByRangeDeleterMongoDB 在数据段迁移期间在源分片的主节点上删除文档的累积数量,该计数会持续增加。
仅当在分片上运行时才出现。
在版本7.1中进行了更改。
shardingStatistics.countDonorMoveChunkLockTimeoutMongoDB 因锁获取超时而在源分片的主节点上中止数据段迁移的累计次数,该计数会持续增加。
仅当在分片上运行时才出现。
shardingStatistics.unfinishedMigrationFromPreviousPrimary选举后上一个主节点留下的未完成迁移数。只有在新当选的
mongod转换为主节点的过程完成后,该值才会更新。仅当在分片上运行时才出现。
shardingStatistics.chunkMigrationConcurrency源分片和接收分片上用于执行数据段迁移操作的线程数。
仅当在分片上运行时才出现。
从 MongoDB 6.3(和 5.0.15)开始可用。
shardingStatistics.unauthorizedDirectShardOps在没有足够授权的情况下尝试进行直接分片操作的次数。如果操作生成警告而不是错误,
unauthorizedDirectShardOps可能会对其进行多次计数。在具有单个分片的分片集群上,您可以通过将
directConnectionChecksWithSingleShard参数设置为true来控制此计数器。
shardingStatistics.databaseCriticalSectionStatistics包含有关数据库关键部分的统计信息的document,包括对有多少操作占用关键部分、有多少操作正在等待以及它们已等待的时间的计数。
8.3版本新增。
shardingStatistics.collectionCriticalSectionStatistics包含有关集合关键部分的统计信息的document,包括对有多少操作占用关键部分、有多少操作正在等待以及它们已等待的时间的计数。
8.3版本新增。
shardingStatistics.databaseVersionUpdateCounters一个带有计数器的文档,用于追踪分片数据库版本的更新,包括自服务器启动以来已进行的集合、清除、访问更改和持久更改的次数等信息。
8.3版本新增。
shardingStatistics.rangeDeleterTasks在范围迁移过程中,当前排队的已准备好运行或正运行的数据段范围删除任务的总数。
查看
config.rangeDeletions集合中的文档,了解数据段迁移后有待从分片中删除的数据段范围的信息。仅在分片节点上运行时出现。
shardingStatistics.resharding包含重新分片操作相关统计信息的文档。
每个分片都返回自己的重新分片操作统计数据。如果分片不参与重新分片操作,则该分片将不包含有关重新分片操作的统计数据。
仅当对分片或配置服务器上运行时才存在。
版本 5.0 中的新增功能。
shardingStatistics.resharding.countStartedcountSucceededcountFailed、 和countCanceled的总和。如果重新分片操作已开始但尚未完成,则总和将进一步递增1。当0mongod启动或重新启动时,总和将被设立为 。仅当对分片或配置服务器上运行时才存在。
版本 5.0 中的新增功能。
shardingStatistics.resharding.countSucceeded成功执行重新分片操作的次数。启动或重新启动
mongod时,该数字将被设置为 0。仅当对分片或配置服务器上运行时才存在。
版本 5.0 中的新增功能。
shardingStatistics.resharding.countFailed重新分片操作失败的次数。启动或重新启动
mongod时,该数字将被设置为 0。仅当对分片或配置服务器上运行时才存在。
版本 5.0 中的新增功能。
shardingStatistics.resharding.countCanceled取消的重新分片操作的数量。启动或重新启动
mongod时,该数字将被设置为 0。仅当对分片或配置服务器上运行时才存在。
版本 5.0 中的新增功能。
shardingStatistics.resharding.active.documentsCopied当前重新分片操作中从发送分片复制到接收分片的文档数量。开始新的重新分片操作时,该数字将被设置为 0。
仅当对分片或配置服务器上运行时才存在。对配置服务器运行时则返回 0。
版本 5.0 中的新增功能。
在版本 6.1 中进行了更新
shardingStatistics.resharding.active.bytesCopied当前重新分片操作中从发送分片复制到接收分片的字节数量。开始新的重新分片操作时,该数字将被设置为 0。
仅当对分片或配置服务器上运行时才存在。对配置服务器运行时则返回 0。
版本 5.0 中的新增功能。
在版本 6.1 中进行了更新
shardingStatistics.resharding.active.countWritesDuringCriticalSection当前重新分片操作在关键部分执行的写入次数。关键部分可防止对当前正在重新分片的集合进行新的传入写入。开始新的重新分片操作时,该数字将被设置为 0。
仅当对分片或配置服务器上运行时才存在。对配置服务器运行时则返回 0。
版本 5.0 中的新增功能。
在版本 6.1 中进行了更新
shardingStatistics.resharding.active.countReadsDuringCriticalSection在重新分片期间,在发送分片的关键部分尝试读取的次数。
6.1版本新增。
shardingStatistics.resharding.active.oplogEntriesFetched从当前重新分片操作的 oplog 获取的条目数。开始新的重新分片操作时,该数字将被设置为 0。
仅当对分片或配置服务器上运行时才存在。对配置服务器运行时则返回 0。
在版本 6.1 中进行了更新
shardingStatistics.resharding.active.oplogEntriesApplied应用于当前重新分片操作的 oplog 的条目数。开始新的重新分片操作时,该数字将被设置为 0。
仅当对分片或配置服务器上运行时才存在。对配置服务器运行时则返回 0。
版本 5.0 中的新增功能。
在版本 6.1 中进行了更新
shardingStatistics.resharding.oldestActive.coordinatorAllShardsHighestRemainingOperationTimeEstimatedMillis在所有分片上计算的剩余描述的最高估值。如果无法计算时间估值,则该值设置为 -1。
6.1版本新增。
shardingStatistics.resharding.oldestActive.coordinatorAllShardsLowestRemainingOperationTimeEstimatedMillis在所有分片上计算的剩余秒数的最低估值。如果无法计算时间估值,则该值设置为 -1。
6.1版本新增。
shardingStatistics.resharding.oldestActive.recipientRemainingOperationTimeEstimatedMillis当前重新分片操作的估计剩余时间(毫秒)。在重新分片之前,或者在无法计算时间时,该值将被设置为 -1。
如果一个分片涉及多个重新分片操作,则此字段包含该分片作为接收分片的最早重新分片操作的剩余时间估计。
6.1版本新增。
shardingStatistics.resharding.oldestActive.totalOperationTimeElapsedMillis当前重新分片操作所用的总时间(毫秒)。开始新的重新分片操作时,时间将被设置为 0。
仅当对分片或配置服务器上运行时才存在。对配置服务器运行时则返回 0。
版本 5.0 中的新增功能。
shardingStatistics.resharding.latencies.collectionCloningTotalRemoteBatchRetrievalTimeMillis接收分片从发送分片处检索文档批次所用的总时间(以毫秒为单位)。
6.1版本新增。
shardingStatistics.resharding.latencies.collectionCloningTotalRemoteBatchesRetrieved接收分片从发送分片处检索的文档的批次总数。
6.1版本新增。
shardingStatistics.resharding.latencies.collectionCloningTotalLocalInsertTimeMillis接收分片从发送分片处插入文档批次所用的总时间(以毫秒为单位)。
6.1版本新增。
shardingStatistics.resharding.latencies.collectionCloningTotalLocalInserts接收者插入的来自捐赠者的文档批次总数。
6.1版本新增。
shardingStatistics.resharding.latencies.oplogFetchingTotalRemoteBatchRetrievalTimeMillis接收分片从发送分片那里检索 oplog 条目批次所花费的总时间(以毫秒为单位)。
6.1版本新增。
shardingStatistics.resharding.latencies.oplogFetchingTotalRemoteBatchesRetrieved接收分片从发送分片处检索的 oplog 条目的批次总数。
6.1版本新增。
shardingStatistics.resharding.latencies.oplogFetchingTotalLocalInsertTimeMillis接收分片从发送分片处插入 oplog 条目批次所用的总时间(以毫秒为单位)。
6.1版本新增。
shardingStatistics.resharding.latencies.oplogFetchingTotalLocalInserts接收分片插入的来自发送分片的 oplog 条目批次总数。
6.1版本新增。
shardingStatistics.resharding.latencies.oplogApplyingTotalLocalBatchRetrievalTimeMillis接收分片检索在获取期间插入的 oplog 条目批次所用的总时间(以毫秒为单位)。
6.1版本新增。
shardingStatistics.resharding.latencies.oplogApplyingTotalLocalBatchesRetrieved在接收分片检索的提取过程中插入的 oplog 条目的批次总数。
6.1版本新增。
shardingStatistics.resharding.latencies.oplogApplyingTotalLocalBatchApplyTimeMillis接收分片应用批量 oplog 条目所花费的总时间(以毫秒为单位)。
6.1版本新增。
shardingStatistics.resharding.latencies.oplogApplyingTotalLocalBatchesApplied接收方应用的 oplog 条目的批处理总数。
6.1版本新增。
shardingStatistics.resharding.totalApplyTimeElapsedMillis当前重新分片操作的应用步骤所用的总时间(毫秒)。在应用步骤中,接收分片根据来自发送分片的新传入写入来修改其数据。开始新的重新分片操作时,时间将被设置为 0。
仅当对分片或配置服务器上运行时才存在。对配置服务器运行时则返回 0。
版本 5.0 中的新增功能。
shardingStatistics.resharding.totalCriticalSectionTimeElapsedMillis当前重新分片操作的关键部分所用的总时间(毫秒)。关键部分可防止对当前正在重新分片的集合进行新的传入写入。开始新的重新分片操作时,时间将被设置为 0。
仅当对分片或配置服务器上运行时才存在。对配置服务器运行时则返回 0。
版本 5.0 中的新增功能。
shardingStatistics.resharding.donorState当前重新分片操作的发送分片的状态。开始新的重新分片操作时,该数字将被设置为 0。
返回的数字含义说明0
unused该分片不是当前重新分片操作中的发送分片。
1
preparing-to-donate源分片正准备向接收分片提供数据。
2
donating-initial-data发送分片正在向接收分片发送数据。
3
donating-oplog-entries发送分片正在向接收分片发送 oplog 条目。
4
preparing-to-block-writes发送分片即将阻止对正在重新分片的集合进行新的传入写入操作。
5
error重新分片操作过程中发生错误。
6
blocking-writes发送分片正在阻止新的传入写入操作,并且发送分片已通知所有接收分片新的传入写入已禁止。
7
done发送分片已经删除旧的分片集合,重新分片操作已完成。
仅当对分片或配置服务器上运行时才存在。对配置服务器运行时则返回 0。
版本 5.0 中的新增功能。
shardingStatistics.resharding.recipientState当前重新分片操作的接收分片的状态。开始新的重新分片操作时,该数字将被设置为 0。
返回的数字含义说明0
unused分片不是当前重新分片操作中的接收分片。
1
awaiting-fetch-timestamp接收分片正在等待发送分片做好发送数据的准备
2
creating-collection接收分片正在创建新的分片集合。
3
cloning接收分片正在接收来自发送分片的数据。
4
applying接收分片正在应用 oplog 条目,以根据来自发送分片的新传入写入来修改数据副本。
5
error重新分片操作过程中发生错误。
6
strict-consistency接收分片将所有数据更改存储在临时集合中。
7
done重新分片操作已完成。
仅当对分片或配置服务器上运行时才存在。对配置服务器运行时则返回 0。
版本 5.0 中的新增功能。
shardingStatistics.numHostsTargeted指示针对
CRUD操作和聚合命令的分片数量。运行CRUD操作或聚合命令时,以下指标将递增。名称说明allShards针对所有分片的命令
manyShards针对多个分片的命令
oneShard针对一个分片的命令
unsharded在未分片的集合上运行的命令
注意
Running the
serverStatuscommand onmongosprovides insight into the CRUD and aggregation operations that run on a sharded cluster.Multi-shard operations can either be scatter-gather or shard specific. Multi-shard scatter-gather operations can consume more resources. By using the
shardingStatistics.numHostsTargetedmetrics you can tune the aggregation queries that run on a sharded cluster.
shardingStatistics.resharding.coordinatorState当前重新分片操作的重新分片协调器的状态。重新分片协调器是在配置服务器主节点上运行的线程。开始新的重新分片操作时,该数字将被设置为 0。
返回的数字含义说明0
unused该分片不是当前重新分片操作中的协调者。
1
initializing重新分片协调器已将协调器文档插入
config.reshardingOperations中,并将reshardingFields添加到原始集合的config.collections条目中。2
preparing-to-donate重新分片协调器
已为临时重新分片集合创建了一个
config.collections条目。已在
config.chunks中插入了基于新分片键的范围条目。已将条目插入到与新分片键关联的任何区域的
config.tags中。
协调器通知参与分片开始重新分片操作。然后,协调器将等待,直到所有发送分片都选择了一个
minFetchTimestamp并准备好发送。3
cloning重新分片协调节点通知发送分片将数据发送给接收分片。协调节点等待所有接收分片完成对发送分片数据的克隆。
4
applying重新分片协调器通知接收分片根据来自发送分片的新传入写入来修改其数据副本。协调器等待所有接收分片完成应用 oplog 条目。
5
blocking-writes重新分片协调节点通知发送分片,以防止对正在重新分片的集合进行新的传入写入操作。然后,协调节点等待所有接收分片进行所有数据更改。
6
aborting在重新分片操作或运行
abortReshardCollection命令(或sh.abortReshardCollection()方法)期间出现不可恢复的错误。6
committing重新分片协调器删除了临时重新分区集合的
config.collections条目。然后,协调器将recipientFields添加到源集合的条目中。仅当对分片或配置服务器上运行时才存在。
版本 5.0 中的新增功能。
shardingStatistics.resharding.opStatus当前重新分片操作的状态。
返回的数字说明-1
重新分片操作不在进行中。
0
重新分片操作成功。
1
重新分片操作失败。
2
重新分片操作已取消。
仅当对分片或配置服务器上运行时才存在。
版本 5.0 中的新增功能。
shardedIndexConsistency
shardedIndexConsistency : { numShardedCollectionsWithInconsistentIndexes : Long("<num>") },
shardedIndexConsistency仅在配置服务器实例上可用。
一份文档:返回分片集合索引一致性检查的结果。
仅当在分片集群的配置服务器副本集的主节点上运行时,返回的指标才有意义。
提示
enableShardedIndexConsistencyCheckparametershardedIndexConsistencyCheckIntervalMSparameter
shardedIndexConsistency.numShardedCollectionsWithInconsistentIndexes仅在配置服务器实例上可用。
分片之间索引不一致的分片集合的数量。如果分片集合在包含集合数据段的每个分片上不具有完全相同的索引(包括索引选项),则分片集合的索引不一致。
要确认分片集合是否存在不一致的索引,请参阅查找分片间不一致的索引。
仅当在分片集群的配置服务器副本集的主节点上运行时,返回的指标才有意义。
提示
enableShardedIndexConsistencyCheckparametershardedIndexConsistencyCheckIntervalMSparameter
引擎加密
storageEngine : { name : <string>, supportsCommittedReads : <boolean>, persistent : <boolean> },
storageEngine.supportsCommittedReads一个布尔值,指示存储引擎是否支持
"majority"读关注。
storageEngine.persistent一个布尔值,指示存储引擎是否将数据持久存储到磁盘。
tcmalloc
注意
tcmalloc 此页面中省略了仅供内部使用的指标。
tcmalloc : { usingPerCPUCaches : <boolean>, // Added in MongoDB 8.0 maxPerCPUCacheSizeBytes : <integer>, // Added in MongoDB 8.0 generic : { current_allocated_bytes : <integer>, heap_size : <integer>, peak_memory_usage : <integer> // Added in MongoDB 8.0 }, tcmalloc : { central_cache_free : <integer>, cpu_free : <integer>, // Added in MongoDB 8.0 release_rate : <integer>, total_bytes_held : <integer>, // Added in MongoDB 8.0 cpuCache : { 0 : { overflows : <integer>, // Added in MongoDB 8.0 underflows : <integer> // Added in MongoDB 8.0 }, } }, tcmalloc_derived : { total_free_bytes : <integer> // Added in MongoDB 8.0 } }
tcmalloc包含服务器内存分配信息的文档。
tcmalloc指标默认包含在serverStatus输出中。要更改tcmalloc部分的详细程度,请指定一个介于0和3(含)之间的整数:如果将详细程度设置为
0,则tcmalloc指标不会包含在serverStatus输出中。如果将详细程度设置为
1,则serverStatus输出将包括默认的tcmalloc指标。如果将详细程度设置为
2,则serverStatus输出包括默认tcmalloc指标和tcmalloc.tcmalloc.cpuCache部分。如果将详细程度设置为
3,则serverStatus输出包括所有tcmalloc指标。
如果您指定的值大于
3,MongoDB 会将verbosity设置为3。例如,要调用
serverStatus并将verbosity设置为2,请运行以下命令:db.runCommand( { serverStatus: 1, tcmalloc: 2 } )
tcmalloc.tcmalloc.release_rate将未使用内存释放给操作系统的速率(单位为字节/秒)。
tcmallocReleaseRate参数决定tcmalloc.tcmalloc.release_rate的值。
事务
transactions : { retriedCommandsCount : Long("<num>"), retriedStatementsCount : Long("<num>"), transactionsCollectionWriteCount : Long("<num>"), currentActive : Long("<num>"), currentInactive : Long("<num>"), currentOpen : Long("<num>"), totalAborted : Long("<num>"), totalCommitted : Long("<num>"), totalStarted : Long("<num>"), totalPrepared : Long("<num>"), totalPreparedThenCommitted : Long("<num>"), totalPreparedThenAborted : Long("<num>"), currentPrepared : Long("<num>"), lastCommittedTransaction : <document> },
transactions : { currentOpen : Long("<num>"), currentActive : Long("<num>"), currentInactive : Long("<num>"), totalStarted : Long("<num>"), totalCommitted : Long("<num>"), totalAborted : Long("<num>"), abortCause : { <String1> : Long("<num>"), <String2> : Long("<num>"), ... }, totalContactedParticipants : Long("<num>"), totalParticipantsAtCommit : Long("<num>"), totalRequestsTargeted : Long("<num>"), commitTypes : { noShards : { initiated : Long("<num>"), successful : Long("<num>"), successfulDurationMicros : Long("<num>") }, singleShard : { initiated : Long("<num>"), successful : Long("<num>"), successfulDurationMicros : Long("<num>") }, singleWriteShard : { initiated : Long("<num>"), successful : Long("<num>"), successfulDurationMicros : Long("<num>") }, readOnly : { initiated : Long("<num>"), successful : Long("<num>"), successfulDurationMicros : Long("<num>") }, twoPhaseCommit : { initiated : Long("<num>"), successful : Long("<num>"), successfulDurationMicros : Long("<num>") }, recoverWithToken : { initiated : Long("<num>"), successful : Long("<num>"), successfulDurationMicros : Long("<num>") } } },
transactions.retriedCommandsCount仅在 mongod 上可用。
提交相应可重试写入命令后收到的重试总次数。也就是说,即使先前的写入已经成功,并在
config.transactions集合中拥有事务和会话的关联记录,仍会尝试可重试写入,例如,对客户端的初始写入响应丢失时。注意
MongoDB 不会重新执行已提交的写入。
总数是所有会话中的总和值。
总数不包括在数据段迁移过程中可能在内部发生的任何可重试写入。
transactions.retriedStatementsCount仅在 mongod 上可用。
The total number of write statements associated with the retried commands in
transactions.retriedCommandsCount.注意
MongoDB 不会重新执行已提交的写入。
总数不包括在数据段迁移过程中可能在内部发生的任何可重试写入。
transactions.transactionsCollectionWriteCount仅在 mongod 上可用。
在提交新的可重试写入语句时触发的写入
config.transactions集合的总次数。对于更新和删除命令,由于只能重试单个文档操作,因此每个语句都只有一次写入。
对于插入操作,每批插入的文档只有一次写入,除非失败导致单独插入每个文档。
该总数包括在迁移过程中写入服务器的
config.transactions集合的次数。
transactions.abortCause仅适用于 mongos。
Breakdown of the
transactions.totalAbortedby cause. If a client issues an explicitabortTransaction, the cause is listed asabort.例如:
totalAborted : Long("5"), abortCause : { abort : Long("1"), DuplicateKey : Long("1"), StaleConfig : Long("3"), SnapshotTooOld : Long("1") },
transactions.totalContactedParticipants仅适用于 mongos。
自上次启动以来,针对通过此
mongos启动的所有事务接触的分片总数。在事务处理期间联系的分片的数量可以包括提交中可能不包含的分片。
transactions.totalParticipantsAtCommit仅适用于 mongos。
自上次启动以来,通过此
mongos启动的所有事务的提交所涉及的分片总数。
transactions.totalRequestsTargeted仅适用于 mongos。
mongos作为其事务的一部分所针对的网络请求总数。
transactions.commitTypes仅适用于 mongos。
按类型细分提交。例如:
noShards : { initiated : Long("0"), successful : Long("0"), successfulDurationMicros : Long("0") }, singleShard : { initiated : Long("5"), successful : Long("5"), successfulDurationMicros : Long("203118") }, singleWriteShard : { initiated : Long("0"), successful : Long("0"), successfulDurationMicros : Long("0") }, readOnly : { initiated : Long("0"), successful : Long("0"), successfulDurationMicros : Long("0") }, twoPhaseCommit : { initiated : Long("1"), successful : Long("1"), successfulDurationMicros : Long("179616") }, recoverWithToken : { initiated : Long("0"), successful : Long("0"), successfulDurationMicros : Long("0") } 提交类型为:
类型说明noShards提交未接触任何分片的事务。
singleShard提交影响单个分片的事务。
singleWriteShard联系到多个分片,但其写入操作仅影响单个分片的事务提交。
readOnly提交仅涉及读取操作的事务。
twoPhaseCommit提交包含写入多个分片的事务。
recoverWithToken提交从另一个实例或该实例重新启动后恢复事务结果。
对于每种提交类型,命令都会返回以下指标:
衡量标准说明initiated启动此类型提交的总次数。
successful此类提交成功的总次数。
successfulDurationMicros成功提交此类型所花费的总时间(以微秒为单位)。
transactions.totalPrepared仅在 mongod 上可用。
自
mongod进程上次启动以来,此服务器上处于准备状态的事务总数。
transactions.totalPreparedThenCommitted仅在 mongod 上可用。
自
mongod进程上次启动以来,在此服务器上准备和提交的事务总数。
transactions.totalPreparedThenAborted仅在 mongod 上可用。
自
mongod进程上次启动以来,在此服务器上准备和中止的事务总数。
transactions.lastCommittedTransaction仅在 mongod 上可用。
mongod为主节点时提交的最后一个事务的详细信息。When returned from a secondary,
lastCommittedTransactionreturns the details of the last transaction committed when that secondary was a primary.lastCommittedTransaction : { operationCount : Long("1"), oplogOperationBytes : Long("211"), writeConcern : { w : "majority", wtimeout : 0 } } 衡量标准说明operationCount事务中写入操作的数量。
oplogOperationBytes事务对应的一个或多个 oplog 条目的大小。[2]
writeConcern用于事务的写关注。
| [2] | MongoDB 根据需要创建尽可能多的 oplog 条目,以封装事务中的所有写入操作。有关详细信息,请参阅 Oplog 大小限制。 |
transportSecurity
transportSecurity : { 1.0 : Long("<num>"), 1.1 : Long("<num>"), 1.2 : Long("<num>"), 1.3 : Long("<num>"), unknown : Long("<num>") },
watchdog
watchdog : { checkGeneration : Long("<num>"), monitorGeneration : Long("<num>"), monitorPeriod : <num> }
注意
watchdog 部分仅在启用存储节点看门狗时出现。
watchdog一个文档,其中报告存储节点看门狗的状态。
watchdog.monitorGeneration检查
mongod使用的所有文件系统的状态的次数。该值在每个monitoringPeriod中递增一次。
watchdog.monitorPeriod由
watchdogPeriodSeconds设置的值。这是状态检查之间的时间段。
WiredTiger
wiredTiger 信息仅在使用 WiredTiger 存储引擎时才显示。服务器的一些统计数据会汇总。
{ uri : 'statistics:', async : { current work queue length : <num>, maximum work queue length : <num>, number of allocation state races : <num>, number of flush calls : <num>, number of operation slots viewed for allocation : <num>, number of times operation allocation failed : <num>, number of times worker found no work : <num>, total allocations : <num>, total compact calls : <num>, total insert calls : <num>, total remove calls : <num>, total search calls : <num>, total update calls : <num> }, block-manager : { blocks pre-loaded : <num>, blocks read : <num>, blocks written : <num>, bytes read : <num>, bytes written : <num>, bytes written for checkpoint : <num>, mapped blocks read : <num>, mapped bytes read : <num> }, cache : { application threads page read from disk to cache count : <num>, application threads page read from disk to cache time (usecs) : <num>, application threads page write from cache to disk count : <num>, application threads page write from cache to disk time (usecs) : <num>, bytes belonging to page images in the cache : <num>, bytes belonging to the cache overflow table in the cache : <num>, bytes currently in the cache : <num>, bytes dirty in the cache cumulative : <num>, bytes not belonging to page images in the cache : <num>, bytes read into cache : <num>, bytes written from cache : <num>, cache overflow cursor application thread wait time (usecs) : <num>, cache overflow cursor internal thread wait time (usecs) : <num>, cache overflow score : <num>, cache overflow table entries : <num>, cache overflow table insert calls : <num>, cache overflow table max on-disk size : <num>, cache overflow table on-disk size : <num>, cache overflow table remove calls : <num>, checkpoint blocked page eviction : <num>, eviction calls to get a page : <num>, eviction calls to get a page found queue empty : <num>, eviction calls to get a page found queue empty after locking : <num>, eviction currently operating in aggressive mode : <num>, eviction empty score : <num>, eviction passes of a file : <num>, eviction server candidate queue empty when topping up : <num>, eviction server candidate queue not empty when topping up : <num>, eviction server evicting pages : <num>, eviction server slept, because we did not make progress with eviction : <num>, eviction server unable to reach eviction goal : <num>, eviction server waiting for a leaf page : <num>, eviction server waiting for an internal page sleep (usec) : <num>, eviction server waiting for an internal page yields : <num>, eviction state : <num>, eviction walk target pages histogram - 0-9 : <num>, eviction walk target pages histogram - 10-31 : <num>, eviction walk target pages histogram - 128 and higher : <num>, eviction walk target pages histogram - 32-63 : <num>, eviction walk target pages histogram - 64-128 : <num>, eviction walks abandoned : <num>, eviction walks gave up because they restarted their walk twice : <num>, eviction walks gave up because they saw too many pages and found no candidates : <num>, eviction walks gave up because they saw too many pages and found too few candidates : <num>, eviction walks reached end of tree : <num>, eviction walks started from root of tree : <num>, eviction walks started from saved location in tree : <num>, eviction worker thread active : <num>, eviction worker thread created : <num>, eviction worker thread evicting pages : <num>, eviction worker thread removed : <num>, eviction worker thread stable number : <num>, files with active eviction walks : <num>, files with new eviction walks started : <num>, force re-tuning of eviction workers once in a while : <num>, forced eviction - pages evicted that were clean count : <num>, forced eviction - pages evicted that were clean time (usecs) : <num>, forced eviction - pages evicted that were dirty count : <num>, forced eviction - pages evicted that were dirty time (usecs) : <num>, forced eviction - pages selected because of too many deleted items count : <num>, forced eviction - pages selected count : <num>, forced eviction - pages selected unable to be evicted count : <num>, forced eviction - pages selected unable to be evicted time : <num>, hazard pointer blocked page eviction : <num>, hazard pointer check calls : <num>, hazard pointer check entries walked : <num>, hazard pointer maximum array length : <num>, in-memory page passed criteria to be split : <num>, in-memory page splits : <num>, internal pages evicted : <num>, internal pages split during eviction : <num>, leaf pages split during eviction : <num>, maximum bytes configured : <num>, maximum page size at eviction : <num>, modified pages evicted : <num>, modified pages evicted by application threads : <num>, operations timed out waiting for space in cache : <num>, overflow pages read into cache : <num>, page split during eviction deepened the tree : <num>, page written requiring cache overflow records : <num>, pages currently held in the cache : <num>, pages evicted by application threads : <num>, pages queued for eviction : <num>, pages queued for eviction post lru sorting : <num>, pages queued for urgent eviction : <num>, pages queued for urgent eviction during walk : <num>, pages read into cache : <num>, pages read into cache after truncate : <num>, pages read into cache after truncate in prepare state : <num>, pages read into cache requiring cache overflow entries : <num>, pages read into cache requiring cache overflow for checkpoint : <num>, pages read into cache skipping older cache overflow entries : <num>, pages read into cache with skipped cache overflow entries needed later : <num>, pages read into cache with skipped cache overflow entries needed later by checkpoint : <num>, pages requested from the cache : <num>, pages seen by eviction walk : <num>, pages selected for eviction unable to be evicted : <num>, pages walked for eviction : <num>, pages written from cache : <num>, pages written requiring in-memory restoration : <num>, percentage overhead : <num>, tracked bytes belonging to internal pages in the cache : <num>, tracked bytes belonging to leaf pages in the cache : <num>, tracked dirty bytes in the cache : <num>, tracked dirty pages in the cache : <num>, unmodified pages evicted : <num> }, capacity : { background fsync file handles considered : <num>, background fsync file handles synced : <num>, background fsync time (msecs) : <num>, bytes read : <num>, bytes written for checkpoint : <num>, bytes written for eviction : <num>, bytes written for log : <num>, bytes written total : <num>, threshold to call fsync : <num>, time waiting due to total capacity (usecs) : <num>, time waiting during checkpoint (usecs) : <num>, time waiting during eviction (usecs) : <num>, time waiting during logging (usecs) : <num>, time waiting during read (usecs) : <num> }, connection : { auto adjusting condition resets : <num>, auto adjusting condition wait calls : <num>, detected system time went backwards : <num>, files currently open : <num>, memory allocations : <num>, memory frees : <num>, memory re-allocations : <num>, pthread mutex condition wait calls : <num>, pthread mutex shared lock read-lock calls : <num>, pthread mutex shared lock write-lock calls : <num>, total fsync I/Os : <num>, total read I/Os : <num>, total write I/Os : <num> }, cursor : { cached cursor count : <num>, cursor bulk loaded cursor insert calls : <num>, cursor close calls that result in cache : <num>, cursor create calls : <num>, cursor insert calls : <num>, cursor insert key and value bytes : <num>, cursor modify calls : <num>, cursor modify key and value bytes affected : <num>, cursor modify value bytes modified : <num>, cursor next calls : <num>, cursor operation restarted : <num>, cursor prev calls : <num>, cursor remove calls : <num>, cursor remove key bytes removed : <num>, cursor reserve calls : <num>, cursor reset calls : <num>, cursor search calls : <num>, cursor search near calls : <num>, cursor sweep buckets : <num>, cursor sweep cursors closed : <num>, cursor sweep cursors examined : <num>, cursor sweeps : <num>, cursor truncate calls : <num>, cursor update calls : <num>, cursor update key and value bytes : <num>, cursor update value size change : <num>, cursors reused from cache : <num>, open cursor count : <num> }, data-handle : { connection data handle size : <num>, connection data handles currently active : <num>, connection sweep candidate became referenced : <num>, connection sweep dhandles closed : <num>, connection sweep dhandles removed from hash list : <num>, connection sweep time-of-death sets : <num>, connection sweeps : <num>, session dhandles swept : <num>, session sweep attempts : <num> }, lock : { checkpoint lock acquisitions : <num>, checkpoint lock application thread wait time (usecs) : <num>, checkpoint lock internal thread wait time (usecs) : <num>, dhandle lock application thread time waiting (usecs) : <num>, dhandle lock internal thread time waiting (usecs) : <num>, dhandle read lock acquisitions : <num>, dhandle write lock acquisitions : <num>, durable timestamp queue lock application thread time waiting (usecs) : <num>, durable timestamp queue lock internal thread time waiting (usecs) : <num>, durable timestamp queue read lock acquisitions : <num>, durable timestamp queue write lock acquisitions : <num>, metadata lock acquisitions : <num>, metadata lock application thread wait time (usecs) : <num>, metadata lock internal thread wait time (usecs) : <num>, read timestamp queue lock application thread time waiting (usecs) : <num>, read timestamp queue lock internal thread time waiting (usecs) : <num>, read timestamp queue read lock acquisitions : <num>, read timestamp queue write lock acquisitions : <num>, schema lock acquisitions : <num>, schema lock application thread wait time (usecs) : <num>, schema lock internal thread wait time (usecs) : <num>, table lock application thread time waiting for the table lock (usecs) : <num>, table lock internal thread time waiting for the table lock (usecs) : <num>, table read lock acquisitions : <num>, table write lock acquisitions : <num>, txn global lock application thread time waiting (usecs) : <num>, txn global lock internal thread time waiting (usecs) : <num>, txn global read lock acquisitions : <num>, txn global write lock acquisitions : <num> }, log : { busy returns attempting to switch slots : <num>, force archive time sleeping (usecs) : <num>, log bytes of payload data : <num>, log bytes written : <num>, log files manually zero-filled : <num>, log flush operations : <num>, log force write operations : <num>, log force write operations skipped : <num>, log records compressed : <num>, log records not compressed : <num>, log records too small to compress : <num>, log release advances write LSN : <num>, log scan operations : <num>, log scan records requiring two reads : <num>, log server thread advances write LSN : <num>, log server thread write LSN walk skipped : <num>, log sync operations : <num>, log sync time duration (usecs) : <num>, log sync_dir operations : <num>, log sync_dir time duration (usecs) : <num>, log write operations : <num>, logging bytes consolidated : <num>, maximum log file size : <num>, number of pre-allocated log files to create : <num>, pre-allocated log files not ready and missed : <num>, pre-allocated log files prepared : <num>, pre-allocated log files used : <num>, records processed by log scan : <num>, slot close lost race : <num>, slot close unbuffered waits : <num>, slot closures : <num>, slot join atomic update races : <num>, slot join calls atomic updates raced : <num>, slot join calls did not yield : <num>, slot join calls found active slot closed : <num>, slot join calls slept : <num>, slot join calls yielded : <num>, slot join found active slot closed : <num>, slot joins yield time (usecs) : <num>, slot transitions unable to find free slot : <num>, slot unbuffered writes : <num>, total in-memory size of compressed records : <num>, total log buffer size : <num>, total size of compressed records : <num>, written slots coalesced : <num>, yields waiting for previous log file close : <num> }, perf : { file system read latency histogram (bucket 1) - 10-49ms : <num>, file system read latency histogram (bucket 2) - 50-99ms : <num>, file system read latency histogram (bucket 3) - 100-249ms : <num>, file system read latency histogram (bucket 4) - 250-499ms : <num>, file system read latency histogram (bucket 5) - 500-999ms : <num>, file system read latency histogram (bucket 6) - 1000ms+ : <num>, file system write latency histogram (bucket 1) - 10-49ms : <num>, file system write latency histogram (bucket 2) - 50-99ms : <num>, file system write latency histogram (bucket 3) - 100-249ms : <num>, file system write latency histogram (bucket 4) - 250-499ms : <num>, file system write latency histogram (bucket 5) - 500-999ms : <num>, file system write latency histogram (bucket 6) - 1000ms+ : <num>, operation read latency histogram (bucket 1) - 100-249us : <num>, operation read latency histogram (bucket 2) - 250-499us : <num>, operation read latency histogram (bucket 3) - 500-999us : <num>, operation read latency histogram (bucket 4) - 1000-9999us : <num>, operation read latency histogram (bucket 5) - 10000us+ : <num>, operation write latency histogram (bucket 1) - 100-249us : <num>, operation write latency histogram (bucket 2) - 250-499us : <num>, operation write latency histogram (bucket 3) - 500-999us : <num>, operation write latency histogram (bucket 4) - 1000-9999us : <num>, operation write latency histogram (bucket 5) - 10000us+ : <num> }, reconciliation : { fast-path pages deleted : <num>, page reconciliation calls : <num>, page reconciliation calls for eviction : <num>, pages deleted : <num>, split bytes currently awaiting free : <num>, split objects currently awaiting free : <num> }, session : { open session count : <num>, session query timestamp calls : <num>, table alter failed calls : <num>, table alter successful calls : <num>, table alter unchanged and skipped : <num>, table compact failed calls : <num>, table compact successful calls : <num>, table create failed calls : <num>, table create successful calls : <num>, table drop failed calls : <num>, table drop successful calls : <num>, table import failed calls : <num>, table import successful calls : <num>, table rebalance failed calls : <num>, table rebalance successful calls : <num>, table rename failed calls : <num>, table rename successful calls : <num>, table salvage failed calls : <num>, table salvage successful calls : <num>, table truncate failed calls : <num>, table truncate successful calls : <num>, table verify failed calls : <num>, table verify successful calls : <num> }, thread-state : { active filesystem fsync calls : <num>, active filesystem read calls : <num>, active filesystem write calls : <num> }, thread-yield : { application thread time evicting (usecs) : <num>, application thread time waiting for cache (usecs) : <num>, connection close blocked waiting for transaction state stabilization : <num>, connection close yielded for lsm manager shutdown : <num>, data handle lock yielded : <num>, get reference for page index and slot time sleeping (usecs) : <num>, log server sync yielded for log write : <num>, page access yielded due to prepare state change : <num>, page acquire busy blocked : <num>, page acquire eviction blocked : <num>, page acquire locked blocked : <num>, page acquire read blocked : <num>, page acquire time sleeping (usecs) : <num>, page delete rollback time sleeping for state change (usecs) : <num>, page reconciliation yielded due to child modification : <num> }, transaction : { Number of prepared updates : <num>, Number of prepared updates added to cache overflow : <num>, Number of prepared updates resolved : <num>, durable timestamp queue entries walked : <num>, durable timestamp queue insert to empty : <num>, durable timestamp queue inserts to head : <num>, durable timestamp queue inserts total : <num>, durable timestamp queue length : <num>, number of named snapshots created : <num>, number of named snapshots dropped : <num>, prepared transactions : <num>, prepared transactions committed : <num>, prepared transactions currently active : <num>, prepared transactions rolled back : <num>, query timestamp calls : <num>, read timestamp queue entries walked : <num>, read timestamp queue insert to empty : <num>, read timestamp queue inserts to head : <num>, read timestamp queue inserts total : <num>, read timestamp queue length : <num>, rollback to stable calls : <num>, rollback to stable updates aborted : <num>, rollback to stable updates removed from cache overflow : <num>, set timestamp calls : <num>, set timestamp durable calls : <num>, set timestamp durable updates : <num>, set timestamp oldest calls : <num>, set timestamp oldest updates : <num>, set timestamp stable calls : <num>, set timestamp stable updates : <num>, transaction begins : <num>, transaction checkpoint currently running : <num>, transaction checkpoint generation : <num>, transaction checkpoint max time (msecs) : <num>, transaction checkpoint min time (msecs) : <num>, transaction checkpoint most recent time (msecs) : <num>, transaction checkpoint scrub dirty target : <num>, transaction checkpoint scrub time (msecs) : <num>, transaction checkpoint total time (msecs) : <num>, transaction checkpoints : <num>, transaction checkpoints skipped because database was clean : <num>, transaction failures due to cache overflow : <num>, transaction fsync calls for checkpoint after allocating the transaction ID : <num>, transaction fsync duration for checkpoint after allocating the transaction ID (usecs) : <num>, transaction range of IDs currently pinned : <num>, transaction range of IDs currently pinned by a checkpoint : <num>, transaction range of IDs currently pinned by named snapshots : <num>, transaction range of timestamps currently pinned : <num>, transaction range of timestamps pinned by a checkpoint : <num>, transaction range of timestamps pinned by the oldest active read timestamp : <num>, transaction range of timestamps pinned by the oldest timestamp : <num>, transaction read timestamp of the oldest active reader : <num>, transaction sync calls : <num>, transactions committed : <num>, transactions rolled back : <num>, update conflicts : <num> }, concurrentTransactions : { write : { out : <num>, available : <num>, totalTickets : <num> }, read : { out : <num>, available : <num>, totalTickets : <num> }, monitor : { timesDecreased: <num>, timesIncreased: <num>, totalAmountDecreased: <num>, totalAmountIncreased: <num> } }, snapshot-window-settings : { total number of SnapshotTooOld errors : <num>, max target available snapshots window size in seconds : <num>, target available snapshots window size in seconds : <num>, current available snapshots window size in seconds : <num>, latest majority snapshot timestamp available : <string>, oldest majority snapshot timestamp available : <string> } }
注意
以下并非详尽列表。
wiredTiger.cache返回有关缓存和从缓存中逐出页面的统计数据的文档。
The following describes some of the key
wiredTiger.cachestatistics:wiredTiger.cache.tracked dirty bytes in the cache缓存中脏数据的大小(字节)。该值应小于
bytes currently in the cache值。
wiredTiger.cache.pages read into cacheNumber of pages read into the cache.
wiredTiger.cache.pages read into cachewith thewiredTiger.cache.pages written from cachecan provide an overview of the I/O activity.
wiredTiger.cache.pages written from cacheNumber of pages written from the cache.
wiredTiger.cache.pages written from cachewith thewiredTiger.cache.pages read into cachecan provide an overview of the I/O activity.
如需调整 WiredTiger 内部缓存大小,请参阅
storage.wiredTiger.engineConfig.cacheSizeGB和--wiredTigerCacheSizeGB。避免将 WiredTiger 内部缓存大小增加到超过其默认值。
wiredTiger.concurrentTransactions在版本7.0中进行了更改。
一个文档,其中返回以下信息:
WiredTiger 存储引擎允许的并发读取事务(读取票证)的数量。
WiredTiger 存储引擎允许的并发写入事务(写入票证)的数量。
系统对允许的并发事务(票证)数量所做的任何调整。
这些设置专属于 MongoDB。要更改并发读取和写入事务(读取和写入票证)的设置,请参阅
storageEngineConcurrentReadTransactions和storageEngineConcurrentWriteTransactions。重要
从版本 7.0 开始,MongoDB 使用默认算法动态调整并发存储引擎事务的最大数量(包括读写票证),以优化过载期间的数据库吞吐量。
下表总结了如何识别 MongoDB 7.0 及之前版本的过载情况:
版本诊断过载情况7.0
持续较长时间的大量排队操作很可能表示过载。
0 的并发存储引擎ACID 事务(票证)长时间可用并不表示出现过载。
6.0 及更早的版本
持续较长时间的大量排队操作很可能表示过载。
并发存储引擎事务(票证)可用性长时间为 0 可能表明出现过载。
writeBacksQueued
writeBacksQueued : <boolean>,
writeBacksQueued一个布尔值,指示是否有来自
mongos实例的操作排队等待重试。通常,此值为 false。另请参阅 writeBacks。