- serverStatus
- Definition
- Syntax
- Behavior
- Output
- Instance Information
- asserts
- connections
- electionMetrics
- extra_info
- flowControl
- freeMonitoring
- globalLock
- logicalSessionRecordCache
- locks
- network
- opLatencies
- opReadConcernCounters
- opWriteConcernCounters
- opcounters
- opcountersRepl
- oplogTruncation
- repl
- security
- sharding
- shardingStatistics
- storageEngine
- transactions
- transportSecurity
- wiredTiger
- writeBacksQueued
- mem
- metrics
- watchdog
- Output Changelog
serverStatus
Definition
serverStatus
- The
serverStatus
command returns a document thatprovides an overview of the database’s state. Monitoringapplications can run this command at a regular interval tocollect statistics about the instance.
Syntax
The command has the following syntax:
- db.runCommand( { serverStatus: 1 } )
The value (i.e. 1
above) does not affect the operation of thecommand. The mongo
shell provides thedb.serverStatus()
wrapper for the command.
See also
Much of the output of serverStatus
is also displayeddynamically by mongostat
. See themongostat command for more information.
Behavior
By default, serverStatus
excludes in its output some content inthe repl document.
To include fields that are excluded by default, specify the top-levelfield and set it to 1
in the command. To exclude fields that areincluded by default, specify the top-level field and set to 0
inthe command.
For example, the following operation suppresses the repl
,metrics
and locks
information in the output.
- db.runCommand( { serverStatus: 1, repl: 0, metrics: 0, locks: 0 } )
The following example includesall repl information in the output:
- db.runCommand( { serverStatus: 1, repl: 1 } )
Output
Note
The output fields vary depending on the version of MongoDB,underlying operating system platform, the storage engine, and thekind of node, including mongos
, mongod
orreplica set member.
For the serverStatus
output specific to the version ofyour MongoDB, refer to the appropriate version of the MongoDB Manual.
Instance Information
- "host" : <string>,
- "advisoryHostFQDNs" : <array>,
- "version" : <string>,
- "process" : <"mongod"|"mongos">,
- "pid" : <num>,
- "uptime" : <num>,
- "uptimeMillis" : <num>,
- "uptimeEstimate" : <num>,
- "localTime" : ISODate(""),
host
- The system’s hostname. In Unix/Linux systems, this should be thesame as the output of the
hostname
command.
New in version 3.2.
An array of the system’s fully qualified domain names (FQDNs).
uptimeEstimate
- The uptime in seconds as calculated from MongoDB’s internalcourse-grained time keeping system.
asserts
- "asserts" : {
- "regular" : <num>,
- "warning" : <num>,
- "msg" : <num>,
- "user" : <num>,
- "rollovers" : <num>
- },
asserts
- A document that reports on the number of assertions raised since theMongoDB process started. While assert errors are typically uncommon,if there are non-zero values for the
asserts
, you shouldcheck the log file for more information. In many cases, these errorsare trivial, but are worth investigating.
asserts.
regular
- The number of regular assertions raised since the MongoDB processstarted. Check the log file for more information about thesemessages.
Changed in version 4.0.
Starting in MongoDB 4.0, the field returns zero 0
.
In earlier versions, the field returns the number of warnings raisedsince the MongoDB process started.
asserts.
msg
- The number of message assertions raised since the MongoDB processstarted. Check the log file for more information about thesemessages.
asserts.
user
- The number of “user asserts” that have occurred since the last timethe MongoDB process started. These are errors that user maygenerate, such as out of disk space or duplicate key. You canprevent these assertions by fixing a problem with your applicationor deployment. Check the MongoDB log for more information.
asserts.
rollovers
- The number of times that the rollover counters have rolled oversince the last time the MongoDB process started. The counters willrollover to zero after 230 assertions. Use thisvalue to provide context to the other values in the
asserts
data structure.
connections
- "connections" : {
- "current" : <num>,
- "available" : <num>,
- "totalCreated" : <num>,
- "active" : <num>
- },
connections
- A document that reports on the status of the connections. Use thesevalues to assess the current load and capacity requirements of theserver.
connections.
current
- The number of incoming connections from clients to the databaseserver . This number includes the current shell session. Considerthe value of
connections.available
to add morecontext to this datum.
The value will include all incoming connections including any shellconnections or connections from other servers, such asreplica set members or mongos
instances.
connections.
available
- The number of unused incoming connections available. Consider thisvalue in combination with the value of
connections.current
to understand the connectionload on the database, and the UNIX ulimit Settings document formore information about system thresholds on available connections.
connections.
totalCreated
- Count of all incoming connections created to the server. Thisnumber includes connections that have since closed.
connections.
active
- The number of active client connections to the server. Active clientconnections refers to client connections that currently haveoperations in progress.
New in version 4.0.7.
electionMetrics
Available starting in 4.2.1 (and 4.0.13)
The electionMetrics
section provides information on electionscalled by this mongod
instance in a bid to become theprimary:
- "electionMetrics" : {
- "stepUpCmd" : {
- "called" : <NumberLong>,
- "successful" : <NumberLong>
- },
- "priorityTakeover" : {
- "called" : <NumberLong>,
- "successful" : <NumberLong>
- },
- "catchUpTakeover" : {
- "called" : <NumberLong>,
- "successful" : <NumberLong>
- },
- "electionTimeout" : {
- "called" : <NumberLong>,
- "successful" : <NumberLong>
- },
- "freezeTimeout" : {
- "called" : <NumberLong>,
- "successful" : <NumberLong>
- },
- "numStepDownsCausedByHigherTerm" : <NumberLong>,
- "numCatchUps" : <NumberLong>,
- "numCatchUpsSucceeded" : <NumberLong>,
- "numCatchUpsAlreadyCaughtUp" : <NumberLong>,
- "numCatchUpsSkipped" : <NumberLong>,
- "numCatchUpsTimedOut" : <NumberLong>,
- "numCatchUpsFailedWithError" :<NumberLong>,
- "numCatchUpsFailedWithNewTerm" : <NumberLong>,
- "numCatchUpsFailedWithReplSetAbortPrimaryCatchUpCmd" : <NumberLong>,
- "averageCatchUpOps" : <double>
- }
electionMetrics.
stepUpCmd
- Metrics on elections that were called by the
mongod
instance as part of anelection handoff
when the primary stepped down.
The stepUpCmd
includes both the number of electionscalled and the number of elections that succeeded.
Available starting in 4.2.1 (and 4.0.13)
electionMetrics.
priorityTakeover
- Metrics on elections that were called by the
mongod
instance because itspriority
is higherthan the primary’s.
The electionMetrics.priorityTakeover
includes both the number ofelections called and the number of elections that succeeded.
Available starting in 4.2.1 (and 4.0.13)
electionMetrics.
catchUpTakeover
- Metrics on elections called by the
mongod
instancebecause it is more-up-to-date than the primary.
The catchUpTakeover
includes both the number ofelections called and the number of elections that succeeded.
See also
settings.catchUpTakeoverDelayMillis
Available starting in 4.2.1 (and 4.0.13)
electionMetrics.
electionTimeout
- Metrics on elections called by the
mongod
instancebecause it has not been able to reach the primary withinsettings.electionTimeoutMillis
.
The electionTimeout
includes both the number ofelections called and the number of elections that succeeded.
See also
settings.electionTimeoutMillis
Available starting in 4.2.1 (and 4.0.13)
electionMetrics.
freezeTimeout
- Metrics on elections called by the
mongod
instanceafter itsfreeze period
(during which themember cannot seek an election) has expired.
The electionMetrics.freezeTimeout
includes both the number ofelections called and the number of elections that succeeded.
Available starting in 4.2.1 (and 4.0.13)
electionMetrics.
numStepDownsCausedByHigherTerm
- Number of times the
mongod
instance stepped downbecause it saw a higher term (i.e. other member/members haveparticipated in additional elections).
Available starting in 4.2.1 (and 4.0.13)
electionMetrics.
numCatchUps
- Number of elections where the
mongod
instance as thenewly-elected primary had to catch up to the highest known oplogentry.
Available starting in 4.2.1 (and 4.0.13)
electionMetrics.
numCatchUpsSucceeded
- Number of times the
mongod
instance as thenewly-elected primary successfully caught up to the highest knownoplog entry.
Available starting in 4.2.1 (and 4.0.13)
electionMetrics.
numCatchUpsAlreadyCaughtUp
- Number of times the
mongod
instance as thenewly-elected primary concluded its catchup process because it wasalready caught up when elected
Available starting in 4.2.1 (and 4.0.13)
electionMetrics.
numCatchUpsSkipped
- Number of times the
mongod
instance as thenewly-elected primary skipped the catchup process.
Available starting in 4.2.1 (and 4.0.13)
electionMetrics.
numCatchUpsTimedOut
- Number of times the
mongod
instance as thenewly-elected primary concluded its catchup process because of thesettings.catchUpTimeoutMillis
limit.
Available starting in 4.2.1 (and 4.0.13)
electionMetrics.
numCatchUpsFailedWithError
- Number of times the newly-elected primary’s catchup process failedwith an error.
Available starting in 4.2.1 (and 4.0.13)
electionMetrics.
numCatchUpsFailedWithNewTerm
- Number of times the newly-elected primary’s catchup processconcluded because another member(s) had a higher term (i.e. othermember/members have participated in additional elections).
Available starting in 4.2.1 (and 4.0.13)
electionMetrics.
numCatchUpsFailedWithReplSetAbortPrimaryCatchUpCmd
- Number of times the newly-elected primary’s catchup processconcluded because the
mongod
received thereplSetAbortPrimaryCatchUp
command.
Available starting in 4.2.1 (and 4.0.13)
electionMetrics.
averageCatchUpOps
- Average number of operations applied during the newly-electedprimary’s catchup processes.
Available starting in 4.2.1
extra_info
- "extra_info" : {
- "note" : "fields vary by platform.",
- "heap_usage_bytes" : <num>,
- "page_faults" : <num>
- },
extra_info.
heap_usage_bytes
- The total size in bytes of heap space used by the database process.Available on Unix/Linux systems only.
extra_info.
page_faults
- The total number of page faults. The
extra_info.page_faults
counter may increasedramatically during moments of poor performance and may correlatewith limited memory environments and larger data sets. Limited andsporadic page faults do not necessarily indicate an issue.
Windows draws a distinction between “hard” page faults involvingdisk I/O, and “soft” page faults that only require moving pages inmemory. MongoDB counts both hard and soft page faults in thisstatistic.
flowControl
New in version 4.2.
- "flowControl" : {
- "enabled" : <boolean>,
- "targetRateLimit" : <int>,
- "timeAcquiringMicros" : <NumberLong>,
- "locksPerOp" : <double>,
- "sustainerRate" : <int>,
- "isLagged" : <boolean>,
- "isLaggedCount" : <int>,
- "isLaggedTimeMicros" : <NumberLong>,
- },
flowControl
- A document that returns statistics on the Flow Control. Withflow control enabled, as the
majority commit
point lag growsclose to theflowControlTargetLagSeconds
, writes on theprimary must obtain tickets before taking locks. As such, themetrics returned are meaningful when run on the primary.
New in version 4.2.
flowControl.
enabled
- A boolean that indicates whether Flow Control isenabled(
true
) or disabled (false
).
See also enableFlowControl
.
New in version 4.2.
flowControl.
targetRateLimit
- When run on the primary, the maximum number of tickets that can beacquired per second.
When run on a secondary, the returned number is a placeholder.
New in version 4.2.
flowControl.
timeAcquiringMicros
- When run on the primary, the total time write operations have waitedto acquire a ticket.
When run on a secondary, the returned number is a placeholder.
New in version 4.2.
flowControl.
locksPerOp
- When run on the primary, an approximation of the number of locks takenper operation.
When run on a secondary, the returned number is a placeholder.
New in version 4.2.
flowControl.
sustainerRate
- When run on the primary, an approximation of operations applied persecond by the secondary that is sustaining the commit point.
When run on a secondary, the returned number is a placeholder.
New in version 4.2.
flowControl.
isLagged
- When run on the primary, a boolean that indicates whether flowcontrol has engaged. Flow control engages when the majoritycommitted lag is greater than some percentage of the configured
flowControlTargetLagSeconds
.
When run on a secondary, the returned boolean is a placeholder.
New in version 4.2.
flowControl.
isLaggedCount
- When run on a primary, the number of times flow control has engagedsince the last restart. Flow control engages when the majoritycommitted lag is greater than some percentage of the
flowControlTargetLagSeconds
.
When run on a secondary, the returned number is a placeholder.
New in version 4.2.
flowControl.
isLaggedTimeMicros
- When run on the primary, the amount of time flow control has spentbeing engaged since the last restart. Flow control engages when themajority committed lag is greater than some percentage of the
flowControlTargetLagSeconds
.
When run on a secondary, the returned number is a placeholder.
New in version 4.2.
freeMonitoring
- "freeMonitoring" : {
- "state" : <string>,
- "retryIntervalSecs" : <NumberLong>,
- "lastRunTime" : <string>,
- "registerErrors" : <NumberLong>,
- "metricsErrors" : <NumberLong>
- },
freeMonitoring
- A document that reports on the free Cloud monitoring.
freeMonitoring.
state
The enablement state of free monitoring. The values can be one ofthe following:
- “enabled”
- “disabled”
- “pending” if the enable free monitoring encountered a registeration error.
freeMonitoring.
registerErrors
- The number of registration errors, incremented on unexpected HTTPstatus or network errors.
globalLock
- "globalLock" : {
- "totalTime" : <num>,
- "currentQueue" : {
- "total" : <num>,
- "readers" : <num>,
- "writers" : <num>
- },
- "activeClients" : {
- "total" : <num>,
- "readers" : <num>,
- "writers" : <num>
- }
- },
Generally, the locks document provides more detaileddata on lock uses.
globalLock.
totalTime
- The time, in microseconds, since the database last started andcreated the
globalLock
. This is roughly equivalentto total server uptime.
globalLock.
currentQueue
- A document that provides information concerning the number ofoperations queued because of a lock.
globalLock.currentQueue.
total
- The total number of operations queued waiting for the lock (i.e.,the sum of
globalLock.currentQueue.readers
andglobalLock.currentQueue.writers
).
A consistently small queue, particularly of shorter operations,should cause no concern. TheglobalLock.activeClients
readers and writersinformation provides context for this data.
globalLock.currentQueue.
readers
- The number of operations that are currently queued and waiting forthe read lock. A consistently small read-queue, particularly ofshorter operations, should cause no concern.
globalLock.currentQueue.
writers
- The number of operations that are currently queued and waiting forthe write lock. A consistently small write-queue, particularly ofshorter operations, is no cause for concern.
globalLock.
activeClients
- A document that provides information about the number of connectedclients and the read and write operations performed by these clients.
Use this data to provide context for theglobalLock.currentQueue
data.
globalLock.activeClients.
total
- The total number of internal client connections to the databaseincluding system threads as well as queued readers and writers.This metric will be higher than the total of
activeClients.readers
andactiveClients.writers
due to the inclusion of system threads.
globalLock.activeClients.
readers
- The number of the active client connections performing readoperations.
globalLock.activeClients.
writers
- The number of active client connections performing write operations.
logicalSessionRecordCache
New in version 3.6.
- "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> // Starting in MongoDB 4.2
- },
logicalSessionRecordCache
- Provides metrics around the caching of server sessions.
logicalSessionRecordCache.
activeSessionsCount
- The number of all active local sessions cached in memory by the
mongod
ormongos
instance since the lastrefresh period.
See also
$listLocalSessions
logicalSessionRefreshMillis
logicalSessionRefreshMinutes
logicalSessionRecordCache.
sessionsCollectionJobCount
- The number that tracks the number of times the refresh process hasrun on the
config.system.sessions
collection.
See also
logicalSessionRefreshMinutes
logicalSessionRecordCache.
lastSessionsCollectionJobDurationMillis
- The length in milliseconds of the last refresh.
logicalSessionRecordCache.
lastSessionsCollectionJobTimestamp
- The time at which the last refresh occurred.
logicalSessionRecordCache.
lastSessionsCollectionJobEntriesRefreshed
- The number of sessions that were refreshed during the last refresh.
logicalSessionRecordCache.
lastSessionsCollectionJobEntriesEnded"
- The number of sessions that ended during the last refresh.
logicalSessionRecordCache.
lastSessionsCollectionJobCursorsClosed"
- The number of cursors that were closed during the last
config.system.sessions
collection refresh.
logicalSessionRecordCache.
transactionReaperJobCount"
- The number that tracks the number of times the transaction recordcleanup process has run on the
config.transactions
collection.
logicalSessionRecordCache.
lastTransactionReaperJobDurationMillis"
- The length (in milleseconds) of the last transaction record cleanup.
logicalSessionRecordCache.
lastTransactionReaperJobTimestamp"
- The time of the last transaction record cleanup.
logicalSessionRecordCache.
lastTransactionReaperJobEntriesCleanedUp"
- The number of entries in the
config.transactions
collectionthat were deleted during the last transaction record cleanup.
logicalSessionRecordCache.
sessionCatalogSize
- For a
mongod
instance, - The size of its in-memory cache of the _config.transactions_entries. This corresponds to retryable writesor transactions whose sessions have not expired within the
localLogicalSessionTimeoutMinutes
.
- For a
- For a
mongos
instance, - The number of the in-memory cache of its sessions that have hadtransactions within the most recent
localLogicalSessionTimeoutMinutes
interval.
- For a
New in version 4.2.
locks
- "locks" : {
- <type> : {
- "acquireCount" : {
- <mode> : NumberLong(<num>),
- ...
- },
- "acquireWaitCount" : {
- <mode> : NumberLong(<num>),
- ...
- },
- "timeAcquiringMicros" : {
- <mode> : NumberLong(<num>),
- ...
- },
- "deadlockCount" : {
- <mode> : NumberLong(<num>),
- ...
- }
- },
- ...
Changed in version 3.0.
A document that reports for each lock <type>
, data on lock<modes>
.
The possible lock <types>
are:
Lock TypeDescriptionParallelBatchWriterMode
Represents a lock for parallel batch writer mode.
In earlier versions, PBWM information was reported as part ofthe Global
lock information.
New in version 4.2.
ReplicationStateTransition
Represents lock taken for replica set member state transitions.
New in version 4.2.
Global
Represents global lock.Database
Represents database lock.Collection
Represents collection lock.Mutex
Represents mutex.Metadata
Represents metadata lock.oplog
Represents lock on the oplog.
The possible <modes>
are:
Lock ModeDescriptionR
Represents Shared (S) lock.W
Represents Exclusive (X) lock.r
Represents Intent Shared (IS) lock.w
Represents Intent Exclusive (IX) lock.
All values are of the NumberLong()
type.
locks.<type>.
acquireWaitCount
- Number of times the
locks.acquireCount
lockacquisitions encountered waits because the locks were held in aconflicting mode.
locks.timeAcquiringMicros
divided bylocks.acquireWaitCount
gives anapproximate average wait time for the particular lock mode.
network
- "network" : {
- "bytesIn" : <num>,
- "bytesOut" : <num>,
- "numRequests" : <num>
- },
network.
bytesIn
- The number of bytes that reflects the amount of network trafficreceived by this database. Use this value to ensure that networktraffic sent to the
mongod
process is consistent withexpectations and overall inter-application traffic.
network.
bytesOut
- The number of bytes that reflects the amount of network traffic sentfrom this database. Use this value to ensure that network trafficsent by the
mongod
process is consistent withexpectations and overall inter-application traffic.
network.
numRequests
- The total number of distinct requests that the server has received.Use this value to provide context for the
network.bytesIn
andnetwork.bytesOut
values to ensure that MongoDB’s network utilization is consistentwith expectations and application use.
opLatencies
Only for mongod
instances
- "opLatencies" : {
- "reads" : <document>,
- "writes" : <document>,
- "commands" : <document>
- },
opLatencies
- A document containing operation latencies for the database as a whole.See latencyStats Document for an description of this document.
Only mongod
instances reportopLatencies
.
opReadConcernCounters
New in version 4.0.6.
Only for mongod instances
- "opReadConcernCounters" : {
- "available" : NumberLong(<num>),
- "linearizable" : NumberLong(<num>),
- "local" : NumberLong(<num>),
- "majority" : NumberLong(<num>),
- "snapshot" : NumberLong(<num>),
- "none" : NumberLong(<num>)
- }
New in version 4.0.6.
A document that reports on the read concern level specified by query operations to themongod
instance since it last started.
Specified w
Description"available"
Number of query operations that specified read concern level"available"
."linearizable"
Number of query operations that specified read concern level"linearizable"
."local"
Number of query operations that specified readconcern level "local"
."majority"
Number of query operations that specified readconcern level "majority"
."snapshot"
Number of query operations that specified readconcern level "snapshot"
."none"
Number of query operations that did not specify a readconcern level and instead used the default read concern level.
The sum of the opReadConcernCounters
equalsopcounters.query
.
opWriteConcernCounters
New in version 4.0.6.
Only for mongod instances
- "opWriteConcernCounters" : {
- "insert" : {
- "wmajority" : NumberLong(<num>),
- "wnum" : {
- "<num>" : NumberLong(<num>),
- ...
- },
- "wtag" : {
- "<tag1>" : NumberLong(<num>),
- ...
- },
- "none" : NumberLong(<num>)
- },
- "update" : {
- "wmajority" : NumberLong(<num>),
- "wnum" : {
- "<num>" : NumberLong(<num>),
- },
- "wtag" : {
- "<tag1>" : NumberLong(<num>),
- ...
- },
- "none" : NumberLong(<num>)
- },
- "delete" : {
- "wmajority" : NumberLong(<num>)
- "wnum" : {
- "<num>" : NumberLong(<num>),
- ...
- },
- "wtag" : {
- "<tag1>" : NumberLong(<num>),
- ...
- },
- "none" : NumberLong(<num>)
- }
- }
opWriteConcernCounters
- A document that reports on the write concerns specified by write operations to the
mongod
instance since it last started.
More specifically, the opWriteConcernCounters
reports on the w: j
) and the timeout option(wtimeout
) of the write concerns does not affect the count. Thecount is incremented even if the operation times out.
Note
Only available whenreportOpWriteConcernCountersInServerStatus
parameter isset to true
(false
by default).
New in version 4.0.6.
A document that reports on the w: mongod
instance since itlast started:
Note
Only available whenreportOpWriteConcernCountersInServerStatus
parameter isset to true
(false
by default).
- "insert" : {
- "wmajority" : NumberLong(<num>),
- "wnum" : {
- "<num>" : NumberLong(<num>),
- ...
- },
- "wtag" : {
- "<tag1>" : NumberLong(<num>),
- ...
- },
- "none" : NumberLong(<num>)
- },
Description"wmajority"
Number of insert operations that specified w:"majority"
."wnum"
Number of insert operations that specified w:<num>
. The counts are grouped by the specific<num>
."wtag"
Number of insert operations that specified w:<tag>
. The counts are grouped by thespecific <tag>
."none"
Number of insert operations that did not specify w
value.These operations use the default w
value of 1
.
The sum of the opWriteConcernCounters.insert
equalsopcounters.insert
.
New in version 4.0.6.
A document that reports on the w: mongod
instance since itlast started:
Note
Only available whenreportOpWriteConcernCountersInServerStatus
parameter isset to true
(false
by default).
- "update" : {
- "wmajority" : NumberLong(<num>),
- "wnum" : {
- "<num>" : NumberLong(<num>),
- },
- "wtag" : {
- "<tag1>" : NumberLong(<num>),
- ...
- },
- "none" : NumberLong(<num>)
- },
Description"wmajority"
Number of update operations that specified w:"majority"
."wnum"
Number of update operations that specified w:<num>
. The counts are grouped by thespecific <num>
."wtag"
Number of update operations that specified w:<tag>
. The counts are grouped by the specific<tag>
."none"
Number of update operations that did not specify w
value.These operations use the default w
value of 1
.
The sum of the opWriteConcernCounters.update
equalsopcounters.update
.
New in version 4.0.6.
A document that reports on the w: mongod
instance since itlast started:
Note
Only available whenreportOpWriteConcernCountersInServerStatus
parameter isset to true
(false
by default).
- "delete" : {
- "wmajority" : NumberLong(<num>)
- "wnum" : {
- "<num>" : NumberLong(<num>),
- ...
- },
- "wtag" : {
- "<tag1>" : NumberLong(<num>),
- ...
- },
- "none" : NumberLong(<num>)
- }
Description"wmajority"
Number of delete operations that specified w:"majority"
."wnum"
Number of delete operations that specified w:<num>
. The counts are grouped by the specific<num>
."wtag"
Number of delete operations that specified w:<tag>
. The counts are grouped by thespecific <tag>
."none"
Number of delete operations that did not specify w
value.These operations use the default w
value of 1
.
The sum of the opWriteConcernCounters.delete
equalsopcounters.delete
.
opcounters
Starting in MongoDB 4.2, the returned opcounters.* values aretype NumberLong. In previous versions, the values are of type NumberInt.
- "opcounters" : {
- "insert" : NumberLong(<num>), // Starting in MongoDB 4.2, type is NumberLong
- "query" : NumberLong(<num>), // Starting in MongoDB 4.2, type is NumberLong
- "update" : NumberLong(<num>), // Starting in MongoDB 4.2, type is NumberLong
- "delete" : NumberLong(<num>), // Starting in MongoDB 4.2, type is NumberLong
- "getmore" : NumberLong(<num>), // Starting in MongoDB 4.2, type is NumberLong
- "command" : NumberLong(<num>), // Starting in MongoDB 4.2, type is NumberLong
- },
opcounters
- A document that reports on database operations by type since the
mongod
instance last started.
These numbers will grow over time until next restart. Analyze thesevalues over time to track database utilization.
Note
The data in opcounters
treats operationsthat affect multiple documents, such as bulk insert ormulti-update operations, as a single operation. Seemetrics.document
for more granulardocument-level operation tracking.
Additionally, these values reflect received operations, andincrement even when operations are not successful.
opcounters.
insert
- The total number of insert operations received since the
mongod
instance last started.
Starting in MongoDB 4.2, the returned opcounters.* values aretype NumberLong. In previous versions, the values are of type NumberInt.
opcounters.
query
- The total number of queries received since the
mongod
instance last started.
Starting in MongoDB 4.2, the returned opcounters.* values aretype NumberLong. In previous versions, the values are of type NumberInt.
opcounters.
update
- The total number of update operations received since the
mongod
instance last started.
Starting in MongoDB 4.2, the returned opcounters.* values aretype NumberLong. In previous versions, the values are of type NumberInt.
opcounters.
delete
- The total number of delete operations since the
mongod
instance last started.
Starting in MongoDB 4.2, the returned opcounters.* values aretype NumberLong. In previous versions, the values are of type NumberInt.
opcounters.
getmore
- The total number of “getmore” operations since the
mongod
instance last started. This counter can be high even if the querycount is low. Secondary nodes sendgetMore
operations as part ofthe replication process.
Starting in MongoDB 4.2, the returned opcounters.* values aretype NumberLong. In previous versions, the values are of type NumberInt.
opcounters.
command
- The total number of commands issued to the database since the
mongod
instance last started.
opcounters.command
counts all commandsexcept the write commands:insert
, update
, and delete
.
Starting in MongoDB 4.2, the returned opcounters.* values aretype NumberLong. In previous versions, the values are of type NumberInt.
opcountersRepl
Starting in MongoDB 4.2, the returned opcountersRepl.* values aretype NumberLong. In previous versions, the values are type NumberInt.
- "opcountersRepl" : {
- "insert" : NumberLong(<num>), // Starting in MongoDB 4.2, type is NumberLong
- "query" : NumberLong(<num>), // Starting in MongoDB 4.2, type is NumberLong
- "update" : NumberLong(<num>), // Starting in MongoDB 4.2, type is NumberLong
- "delete" : NumberLong(<num>), // Starting in MongoDB 4.2, type is NumberLong
- "getmore" : NumberLong(<num>), // Starting in MongoDB 4.2, type is NumberLong
- "command" : NumberLong(<num>), // Starting in MongoDB 4.2, type is NumberLong
- },
opcountersRepl
- A document that reports on database replication operations by typesince the
mongod
instance last started.
These values only appear when the current host is a member of areplica set.
These values will differ from the opcounters
valuesbecause of how MongoDB serializes operations during replication.See Replication for more information on replication.
These numbers will grow over time in response to database use untilnext restart. Analyze these values over time to track databaseutilization.
Starting in MongoDB 4.2, the returned opcountersRepl.* values aretype NumberLong. In previous versions, the values are type NumberInt.
opcountersRepl.
insert
- The total number of replicated insert operations since the
mongod
instance last started.
Starting in MongoDB 4.2, the returned opcountersRepl.* values aretype NumberLong. In previous versions, the values are type NumberInt.
opcountersRepl.
query
- The total number of replicated queries since the
mongod
instance last started.
Starting in MongoDB 4.2, the returned opcountersRepl.* values aretype NumberLong. In previous versions, the values are type NumberInt.
opcountersRepl.
update
- The total number of replicated update operations since the
mongod
instance last started.
Starting in MongoDB 4.2, the returned opcountersRepl.* values aretype NumberLong. In previous versions, the values are type NumberInt.
opcountersRepl.
delete
- The total number of replicated delete operations since the
mongod
instance last started.
Starting in MongoDB 4.2, the returned opcountersRepl.* values aretype NumberLong. In previous versions, the values are type NumberInt.
opcountersRepl.
getmore
- The total number of “getmore” operations since the
mongod
instance last started. This counter can be high even if the querycount is low. Secondary nodes sendgetMore
operations as part ofthe replication process.
Starting in MongoDB 4.2, the returned opcountersRepl.* values aretype NumberLong. In previous versions, the values are type NumberInt.
opcountersRepl.
command
- The total number of replicated commands issued to the database sincethe
mongod
instance last started.
Starting in MongoDB 4.2, the returned opcountersRepl.* values aretype NumberLong. In previous versions, the values are type NumberInt.
oplogTruncation
- "oplogTruncation" : {
- "totalTimeProcessingMicros" : <NumberLong>,
- "processingMethod" : <string>,
- "totalTimeTruncatingMicros" : <NumberLong>,
- "truncateCount" : <NumberLong>
- },
New in version 4.2.1: For WiredTiger storage engine
A document that reports on oplogtruncations.
The field only appears when the current instance is a member of areplica set and uses WiredTiger Storage Engine.
New in version 4.2.1.
The total time taken, in microseconds, to scan or sample the oplogto determine the oplog truncation points.
See oplogTruncation.processingMethod
New in version 4.2.1.
The method used at start up to determine the oplog truncation points.The value can be either "sampling"
or "scanning"
.
New in version 4.2.1.
The cumulative time spent, in microseconds, performing oplog truncations.
New in version 4.2.1.
The cumulative number of oplog truncations.
repl
- "repl" : {
- "hosts" : [
- <string>,
- <string>,
- <string>
- ],
- "setName" : <string>,
- "setVersion" : <num>,
- "ismaster" : <boolean>,
- "secondary" : <boolean>,
- "primary" : <hostname>,
- "me" : <hostname>,
- "electionId" : ObjectId(""),
- "rbid" : <num>,
- "replicationProgress" : [
- {
- "rid" : <ObjectId>,
- "optime" : { ts: <timestamp>, term: <num> },
- "host" : <hostname>,
- "memberId" : <num>
- },
- ...
- ]
- }
repl
- A document that reports on the replica set configuration.
repl
only appear when the current host is a replicaset. See Replication for more information on replication.
repl.
setName
- A string with the name of the current replica set. This valuereflects the
—replSet
command lineargument, orreplSetName
value in theconfiguration file.
repl.
ismaster
- A boolean that indicates whether the current node is theprimary of the replica set.
repl.
secondary
- A boolean that indicates whether the current node is asecondary member of the replica set.
New in version 3.0.
The hostname and port information ("host:port"
) of the currentprimary member of the replica set.
New in version 3.0: The hostname and port information ("host:port"
) for the currentmember of the replica set.
New in version 3.0.
Rollback identifier. Used to determine if a rollback hashappened for this mongod
instance.
Changed in version 3.2: Previously named serverStatus.repl.slaves
.
New in version 3.0.
An array with one document for each member of the replica set thatreports replication process to this member. Typically this is theprimary, or secondaries if using chained replication.
To include this output, you must pass the repl
option to theserverStatus
, as in the following:
- db.serverStatus({ "repl": 1 })
- db.runCommand({ "serverStatus": 1, "repl": 1 })
The content of the repl.replicationProgress
sectiondepends on the source of each member’s replication. This sectionsupports internal operation and is for internal and diagnostic use only.
repl.replicationProgress[n].
rid
- An ObjectId used as an ID for the members of the replicaset. For internal use only.
repl.replicationProgress[n].
optime
- Information regarding the last operation from the oplog thatthe member applied, as reported from this member.
repl.replicationProgress[n].
host
- The name of the host in
[hostname]:[port]
format for the memberof the replica set.
security
- "security" : {
- "SSLServerSubjectName": <string>,
- "SSLServerHasCertificateAuthority": <boolean>,
- "SSLServerCertificateExpirationDate": <date>
- },
New in version 3.0.
A document that reports on security configuration and details;specifically, this section reports on themongod
/mongos
instance’s TLS/SSLcertificate.
The security
information only appears formongod
instances and mongos
instanceswith support for TLS/SSL.
security.
SSLServerSubjectName
The subject name associated with the
mongod
/mongos
instance’s TLS/SSLcertificate.A boolean that is:
security.
SSLServerCertificateExpirationDate
- The expiration date and time of the
mongod
/mongos
instance’s TLS/SSLcertificate.
sharding
New in version 3.2: When run on mongos
, the command returns shardinginformation.
Changed in version 3.6: Starting in MongoDB 3.6, shard members return sharding information.
- {
- "configsvrConnectionString" : "csRS/cfg1.example.net:27019,cfg2.example.net:27019,cfg2.example.net:27019",
- "lastSeenConfigServerOpTime" : {
- "ts" : Timestamp(1517462189, 1),
- "t" : NumberLong(1)
- },
- "maxChunkSizeInBytes" : NumberLong(67108864)
- }
sharding
- A document with data regarding the sharded cluster. The
lastSeenConfigServerOpTime
is present onlyfor amongos
or a shard member, not for a configserver.
sharding.
lastSeenConfigServerOpTime
The latest optime of the CSRS primary that the mongos orthe shard member has seen. The optime document includes:
ts
, the Timestamp ofthe operation.t
, theterm
in which theoperation was originally generated on the primary.ThelastSeenConfigServerOpTime
is presentonly if the sharded cluster uses CSRS.
New in version 3.6.
The maximum size limit for a chunk. Ifthe chunk size has been updated recently on the config server, themaxChunkSizeInBytes
may not reflect themost recent value.
shardingStatistics
New in version 4.0.
- Shard
- mongos
When run on a member of a shard:
- "shardingStatistics" : {
- "countStaleConfigErrors" : NumberLong(<num>),
- "countDonorMoveChunkStarted" : NumberLong(<num>),
- "totalDonorChunkCloneTimeMillis" : NumberLong(<num>),
- "totalCriticalSectionCommitTimeMillis" : NumberLong(<num>),
- "totalCriticalSectionTimeMillis" : NumberLong(<num>),
- "countDocsClonedOnRecipient" : NumberLong(<num>),
- "countDocsClonedOnDonor" : NumberLong(<num>),
- "countRecipientMoveChunkStarted" : NumberLong(<num>),
- "countDocsDeletedOnDonor" : NumberLong(<num>),
- "countDonorMoveChunkLockTimeout" : NumberLong(<num>),
- "catalogCache" : {
- "numDatabaseEntries" : NumberLong(<num>),
- "numCollectionEntries" : NumberLong(<num>),
- "countStaleConfigErrors" : NumberLong(<num>),
- "totalRefreshWaitTimeMicros" : NumberLong(<num>),
- "numActiveIncrementalRefreshes" : NumberLong(<num>),
- "countIncrementalRefreshesStarted" : NumberLong(<num>),
- "numActiveFullRefreshes" : NumberLong(<num>),
- "countFullRefreshesStarted" : NumberLong(<num>),
- "countFailedRefreshes" : NumberLong(<num>)
- }
- },
When run on a mongos
:
- "shardingStatistics" : {
- "catalogCache" : {
- "numDatabaseEntries" : NumberLong(<num>),
- "numCollectionEntries" : NumberLong(<num>),
- "countStaleConfigErrors" : NumberLong(<num>),
- "totalRefreshWaitTimeMicros" : NumberLong(<num>),
- "numActiveIncrementalRefreshes" : NumberLong(<num>),
- "countIncrementalRefreshesStarted" : NumberLong(<num>),
- "numActiveFullRefreshes" : NumberLong(<num>),
- "countFullRefreshesStarted" : NumberLong(<num>),
- "countFailedRefreshes" : NumberLong(<num>)
- }
- },
shardingStatistics.
countStaleConfigErrors
- The total number of times that threads hit stale config exception.Since a stale config exception triggers a refresh of the metadata,this number is roughly proportional to the number of metadatarefreshes.
Only present when run on a shard.
shardingStatistics.
countDonorMoveChunkStarted
- The total number of times that the
moveChunk
commandhas started on the shard, of which this node is a member, as part ofa chunk migration process. Thisincreasing number does not consider whether the chunk migrationssucceed or not.
Only present when run on a shard.
shardingStatistics.
totalDonorChunkCloneTimeMillis
- The cumulative time, in milliseconds, taken by the clone phaseof the chunk migrations from thisshard, of which this node is a member. Specifically, for eachmigration from this shard, the tracked time starts with the
moveChunk
command and ends before the destination shardenters a catch-up phase to apply changes that occurred during thechunk migrations.
Only present when run on a shard.
shardingStatistics.
totalCriticalSectionCommitTimeMillis
- The cumulative time, in milliseconds, taken by the updatemetadata phase of the chunk migrationsfrom this shard, of which this node is a member. During the updatemetadata phase, all operations on the collection are blocked.
Only present when run on a shard.
shardingStatistics.
totalCriticalSectionTimeMillis
- The cumulative time, in milliseconds, taken by the catch-upphase and the update metadata phase of the chunk migrations from this shard, of which this node isa member.
To calculate the duration of the catch-up phase, subtracttotalCriticalSectionCommitTimeMillis
fromtotalCriticalSectionTimeMillis
- totalCriticalSectionTimeMillis - totalCriticalSectionCommitTimeMillis
Only present when run on a shard.
shardingStatistics.
countDocsClonedOnRecipient
- Cumulative, always-increasing count of documents that have beencloned on this member where it acted as the primary of the recipientshard.
Only present when run on a shard.
New in version 4.2.
shardingStatistics.
countDocsClonedOnDonor
- Cumulative, always-increasing count of documents that haves beencloned on this member where it acted as the primary of the donorshard.
Only present when run on a shard.
New in version 4.2.
shardingStatistics.
countRecipientMoveChunkStarted
- Cumulative, always-increasing count of chunks this member, acting asthe primary of the recipient shard, has started to receive (whetherthe move has succeeded or not.
Only present when run on a shard.
New in version 4.2.
shardingStatistics.
countDocsDeletedOnDonor
- Cumulative, always-increasing count of documents that have beendeleted on this member during chunk migration where the member actedas the primary of the donor shard.
Only present when run on a shard.
New in version 4.2.
shardingStatistics.
countDonorMoveChunkLockTimeout
- Cumulative, always-increasing count of chunk migrations that wereaborted due to lock acquisition timeouts, where the member acted asthe primary of the donor shard.
Only present when run on a shard.
New in version 4.2.
shardingStatistics.
catalogCache
- A document with statistics about the cluster’s routing information cache.
shardingStatistics.catalogCache.
numDatabaseEntries
- The total number of database entries that are currently in thecatalog cache.
shardingStatistics.catalogCache.
numCollectionEntries
- The total number of collection entries (across all databases) thatare currently in the catalog cache.
shardingStatistics.catalogCache.
countStaleConfigErrors
- The total number of times that threads hit stale config exception. Astale config exception triggers a refresh of the metadata.
shardingStatistics.catalogCache.
totalRefreshWaitTimeMicros
- The cumulative time, in microseconds, that threads had to wait for arefresh of the metadata.
shardingStatistics.catalogCache.
numActiveIncrementalRefreshes
- The number of incremental catalog cache refreshes that are currentlywaiting to complete.
shardingStatistics.
countIncrementalRefreshesStarted
- The cumulative number of incremental refreshes that have started.
shardingStatistics.catalogCache.
numActiveFullRefreshes
- The number of full catalog cache refreshes that are currentlywaiting to complete.
shardingStatistics.catalogCache.
countFullRefreshesStarted
- The cumulative number of full refreshes that have started.
shardingStatistics.catalogCache.
countFailedRefreshes
- The cumulative number of full or incremental refreshes that have failed.
storageEngine
New in version 3.0.
- "storageEngine" : {
- "name" : <string>,
- "supportsCommittedReads" : <boolean>,
- "persistent" : <boolean>
- },
New in version 3.2.
A boolean that indicates whether the storage engine supports"majority"
read concern.
New in version 3.2.6.
A boolean that indicates whether the storage engine does or does not persist data to disk.
transactions
- mongod
- mongos
New in version 3.6.3.
- "transactions" : {
- "retriedCommandsCount" : <NumberLong>,
- "retriedStatementsCount" : <NumberLong>,
- "transactionsCollectionWriteCount" : <NumberLong>,
- "currentActive" : <NumberLong>,
- "currentInactive" : <NumberLong>,
- "currentOpen" : <NumberLong>,
- "totalAborted" : <NumberLong>,
- "totalCommitted" : <NumberLong>,
- "totalStarted" : <NumberLong>,
- "totalPrepared" : <NumberLong>,
- "totalPreparedThenCommitted" : <NumberLong>,
- "totalPreparedThenAborted" : <NumberLong>,
- "currentPrepared" : <NumberLong>
- },
New in version 4.2.
- "transactions" : {
- "totalStarted" : <NumberLong>,
- "totalCommitted" : <NumberLong>,
- "totalAborted" : <NumberLong>,
- "abortCause" : {
- <String1> : <NumberLong>,
- <String2>" : <NumberLong>,
- ...
- },
- "totalContactedParticipants" : <NumberLong>,
- "totalParticipantsAtCommit" : <NumberLong>,
- "totalRequestsTargeted" : <NumberLong>,
- "commitTypes" : {
- "noShards" : {
- "initiated" : <NumberLong>,
- "successful" : <NumberLong>,
- "successfulDurationMicros" : <NumberLong>,
- },
- "singleShard" : {
- "initiated" : <NumberLong>,
- "successful" : <NumberLong>,
- "successfulDurationMicros" : <NumberLong>,
- },
- "singleWriteShard" : {
- "initiated" : <NumberLong>,
- "successful" : <NumberLong>,
- "successfulDurationMicros" : <NumberLong>,
- },
- "readOnly" : {
- "initiated" : <NumberLong>,
- "successful" : <NumberLong>,
- "successfulDurationMicros" : <NumberLong>,
- },
- "twoPhaseCommit" : {
- "initiated" : <NumberLong>,
- "successful" : <NumberLong>,
- "successfulDurationMicros" :<NumberLong>,
- },
- "recoverWithToken" : {
- "initiated" : <NumberLong>,
- "successful" : <NumberLong>,
- "successfulDurationMicros" : <NumberLong>,
- }
- }
- },
When run on a mongod
, a document with data about theretryable writes andtransactions.
When run on a mongos
, a document with data about thetransactions run on the instance.
The total number of retry attempts that have been received after thecorresponding retryable write command has already been committed.That is, a retryable write is attempted even though the write haspreviously succeeded and has an associated record for thetransaction and session in the config.transactions
collection, such as when the initial write response to the client islost.
Note
MongoDB does not re-execute the committed writes.
The total is across all sessions.
The total does not include any retryable writes that may happeninternally as part of a chunk migration.
New in version 3.6.3.
The total number of write statements associated with the retriedcommands in transactions.retriedCommandsCount
.
Note
MongoDB does not re-execute the committed writes.
The total does not include any retryable writes that may happeninternally as part of a chunk migration.
New in version 3.6.3.
The total number of writes to the config.transactions
collection, triggered when a new retryable write statement iscommitted.
For update and delete commands, since only single documentoperations are retryable, there is one write per statement.
For insert operations, there is one write per batch of documentsinserted, except when a failure leads to each document beinginserted separately.
The total includes writes to a server’s config.transactions
collection that occur as part of a migration.
New in version 3.6.3.
The total number of open transactions currently executing a command.
New in version 4.0.2.
The total number of open transactions that are not currentlyexecuting a command.
New in version 4.0.2.
The total number of open transactions. A transaction is opened whenthe first command is run as a part of that transaction, and staysopen until the transaction either commits or aborts.
New in version 4.0.2.
For the mongod
, the total number of transactionsaborted on this instance since its last startup.
For the mongos
, the total number of transactionsaborted through this instance since its last startup.
For the mongod
, the total number of transactionscommitted on the instance since its last startup.
For the mongos
,the total number of transactionscommitted through this instance since its last startup.
For the mongod
, the total number of transactionsstarted on this instance since its last startup.
For the mongos
, the total number of transactionsstarted on this instance since its last startup.
Breakdown of the transactions.totalAborted
by cause.If a client issues an explicit abortTransaction
, the cause islisted as abort
.
For example:
- "totalAborted" : NumberLong(5),
- "abortCause" : {
- "abort" : NumberLong(1),
- "DuplicateKey" : NumberLong(1),
- "StaleConfig" : NumberLong(3),
- "SnapshotTooOld" : NumberLong(1)
- },
New in version 4.2.
The total number of shards contacted for all transactions startedthrough this mongos
since its last startup.
The number of shards contacted during the transaction processes caninclude those shards that may not be included as part of the commit.
New in version 4.2.
Total number of shards involved in the commit for all transactionsstarted through this mongos
since its last startup.
New in version 4.2.
Total number of network requests targeted by themongos
as part of its transactions.
New in version 4.2.
Breakdown of the commits by types. For example:
- "noShards" : {
- "initiated" : NumberLong(0),
- "successful" : NumberLong(0),
- "successfulDurationMicros" : NumberLong(0)
- },
- "singleShard" : {
- "initiated" : NumberLong(5),
- "successful" : NumberLong(5),
- "successfulDurationMicros" : NumberLong(203118)
- },
- "singleWriteShard" : {
- "initiated" : NumberLong(0),
- "successful" : NumberLong(0),
- "successfulDurationMicros" : NumberLong(0)
- },
- "readOnly" : {
- "initiated" : NumberLong(0),
- "successful" : NumberLong(0),
- "successfulDurationMicros" : NumberLong(0)
- },
- "twoPhaseCommit" : {
- "initiated" : NumberLong(1),
- "successful" : NumberLong(1),
- "successfulDurationMicros" : NumberLong(179616)
- },
- "recoverWithToken" : {
- "initiated" : NumberLong(0),
- "successful" : NumberLong(0),
- "successfulDurationMicros" : NumberLong(0)
- }
The types of commit are:
TypeDescriptionnoShards
Commits of transactions that did not contact any shards.singleShard
Commits of transactions that affected a single shard.singleWriteShard
Commits of transactions that contacted multiple shards butwhose write operations only affected a single shard.readOnly
Commits of transactions that only involved read operations.twoPhaseCommit
Commits of transactions that included writes to multipleshardsrecoverWithToken
Commits that recovered the outcome of transactions fromanother instance or after this instance was restarted.
For each commit type, the command returns the following metrics:
MetricsDescriptioninitiated
Total number of times that commits of this type wereinitiated.successful
Total number of times that commits of this type succeeded.successfulDurationMicros
Total time, in microseconds, taken by successful commits ofthis type.
New in version 4.2.
The total number of transactions in prepared state on this serversince the mongod
process’s last startup.
New in version 4.2.
The total number of transactions that were prepared and committed onthis server since the mongod
process’s laststartup.
New in version 4.2.
The total number of transactions that were prepared and aborted onthis server since the mongod
process’s laststartup.
New in version 4.2.
The current number of transactions in prepared state on this server.
New in version 4.2.
transportSecurity
New in version 4.0.2: (Also available in 3.6.7+ and 3.4.17+)
- "transportSecurity" : {
- "1.0" : <NumberLong>,
- "1.1" : <NumberLong>,
- "1.2" : <NumberLong>,
- "1.3" : <NumberLong>,
- "unknown" :<NumberLong>
- },
New in version 4.0.2: (Also available in 3.6.7+ and 3.4.17+)
The cumulative number of TLS mongod
or mongos
instance. The value is reset upon restart.
wiredTiger
wiredTiger
information only appears if using the WiredTiger storage engine. Some of the statistics, such aswiredTiger.LSM
, roll up for the server.
- "wiredTiger" : {
- "uri" : "statistics:",
- "LSM" : {
- "sleep for LSM checkpoint throttle" : <num>,
- "sleep for LSM merge throttle" : <num>,
- "rows merged in an LSM tree" : <num>,
- "application work units currently queued" : <num>,
- "merge work units currently queued" : <num>,
- "tree queue hit maximum" : <num>,
- "switch work units currently queued" : <num>,
- "tree maintenance operations scheduled" : <num>,
- "tree maintenance operations discarded" : <num>,
- "tree maintenance operations executed" : <num>
- },
- "async" : {
- "number of allocation state races" : <num>,
- "number of operation slots viewed for allocation" : <num>,
- "current work queue length" : <num>,
- "number of flush calls" : <num>,
- "number of times operation allocation failed" : <num>,
- "maximum work queue length" : <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" : {
- "mapped bytes read" : <num>,
- "bytes read" : <num>,
- "bytes written" : <num>,
- "mapped blocks read" : <num>,
- "blocks pre-loaded" : <num>,
- "blocks read" : <num>,
- "blocks written" : <num>
- },
- "cache" : {
- "tracked dirty bytes in the cache" : <num>,
- "tracked bytes belonging to internal pages in the cache" : <num>,
- "bytes currently in the cache" : <num>,
- "tracked bytes belonging to leaf pages in the cache" : <num>,
- "maximum bytes configured" : <num>,
- "tracked bytes belonging to overflow pages in the cache" : <num>,
- "bytes read into cache" : <num>,
- "bytes written from cache" : <num>,
- "pages evicted by application threads" : <num>,
- "checkpoint blocked page eviction" : <num>,
- "unmodified pages evicted" : <num>,
- "page split during eviction deepened the tree" : <num>,
- "modified pages evicted" : <num>,
- "pages selected for eviction unable to be evicted" : <num>,
- "pages evicted because they exceeded the in-memory maximum" : <num>,
- "pages evicted because they had chains of deleted items" : <num>,
- "failed eviction of pages that exceeded the in-memory maximum" : <num>,
- "hazard pointer blocked page eviction" : <num>,
- "internal pages evicted" : <num>,
- "maximum page size at eviction" : <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 populating queue, but not evicting pages" : <num>,
- "eviction server unable to reach eviction goal" : <num>,
- "internal pages split during eviction" : <num>,
- "leaf pages split during eviction" : <num>,
- "pages walked for eviction" : <num>,
- "eviction worker thread evicting pages" : <num>,
- "in-memory page splits" : <num>,
- "in-memory page passed criteria to be split" : <num>,
- "lookaside table insert calls" : <num>,
- "lookaside table remove calls" : <num>,
- "percentage overhead" : <num>,
- "tracked dirty pages in the cache" : <num>,
- "pages currently held in the cache" : <num>,
- "pages read into cache" : <num>,
- "pages read into cache requiring lookaside entries" : <num>,
- "pages written from cache" : <num>,
- "page written requiring lookaside records" : <num>,
- "pages written requiring in-memory restoration" : <num>
- },
- "connection" : {
- "pthread mutex condition wait calls" : <num>,
- "files currently open" : <num>,
- "memory allocations" : <num>,
- "memory frees" : <num>,
- "memory re-allocations" : <num>,
- "total read I/Os" : <num>,
- "pthread mutex shared lock read-lock calls" : <num>,
- "pthread mutex shared lock write-lock calls" : <num>,
- "total write I/Os" : <num>
- },
- "cursor" : {
- "cursor create calls" : <num>,
- "cursor insert calls" : <num>,
- "cursor next calls" : <num>,
- "cursor prev calls" : <num>,
- "cursor remove calls" : <num>,
- "cursor reset calls" : <num>,
- "cursor restarted searches" : <num>,
- "cursor search calls" : <num>,
- "cursor search near calls" : <num>,
- "truncate calls" : <num>,
- "cursor update calls" : <num>
- },
- "data-handle" : {
- "connection data handles currently active" : <num>,
- "session dhandles swept" : <num>,
- "session sweep attempts" : <num>,
- "connection sweep dhandles closed" : <num>,
- "connection sweep candidate became referenced" : <num>,
- "connection sweep dhandles removed from hash list" : <num>,
- "connection sweep time-of-death sets" : <num>,
- "connection sweeps" : <num>
- },
- "log" : {
- "total log buffer size" : <num>,
- "log bytes of payload data" : <num>,
- "log bytes written" : <num>,
- "yields waiting for previous log file close" : <num>,
- "total size of compressed records" : <num>,
- "total in-memory size of compressed records" : <num>,
- "log records too small to compress" : <num>,
- "log records not compressed" : <num>,
- "log records compressed" : <num>,
- "log flush operations" : <num>,
- "maximum log file size" : <num>,
- "pre-allocated log files prepared" : <num>,
- "number of pre-allocated log files to create" : <num>,
- "pre-allocated log files not ready and missed" : <num>,
- "pre-allocated log files used" : <num>,
- "log release advances write LSN" : <num>,
- "records processed by log scan" : <num>,
- "log scan records requiring two reads" : <num>,
- "log scan operations" : <num>,
- "consolidated slot closures" : <num>,
- "written slots coalesced" : <num>,
- "logging bytes consolidated" : <num>,
- "consolidated slot joins" : <num>,
- "consolidated slot join races" : <num>,
- "busy returns attempting to switch slots" : <num>,
- "consolidated slot join transitions" : <num>,
- "consolidated slot unbuffered writes" : <num>,
- "log sync operations" : <num>,
- "log sync_dir operations" : <num>,
- "log server thread advances write LSN" : <num>,
- "log write operations" : <num>,
- "log files manually zero-filled" : <num>
- },
- "reconciliation" : {
- "pages deleted" : <num>,
- "fast-path pages deleted" : <num>,
- "page reconciliation calls" : <num>,
- "page reconciliation calls for eviction" : <num>,
- "split bytes currently awaiting free" : <num>,
- "split objects currently awaiting free" : <num>
- },
- "session" : {
- "open cursor count" : <num>,
- "open session count" : <num>
- },
- "thread-yield" : {
- "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>
- },
- "transaction" : {
- "transaction begins" : <num>,
- "transaction checkpoints" : <num>,
- "transaction checkpoint generation" : <num>,
- "transaction checkpoint currently running" : <num>,
- "transaction checkpoint max time (msecs)" : <num>,
- "transaction checkpoint min time (msecs)" : <num>,
- "transaction checkpoint most recent time (msecs)" : <num>,
- "transaction checkpoint total time (msecs)" : <num>,
- "transactions committed" : <num>,
- "transaction failures due to cache overflow" : <num>,
- "transaction range of IDs currently pinned by a checkpoint" : <num>,
- "transaction range of IDs currently pinned" : <num>,
- "transaction range of IDs currently pinned by named snapshots" : <num>,
- "transactions rolled back" : <num>,
- "number of named snapshots created" : <num>,
- "number of named snapshots dropped" : <num>,
- "transaction sync calls" : <num>
- },
- "concurrentTransactions" : {
- "write" : {
- "out" : <num>,
- "available" : <num>,
- "totalTickets" : <num>
- },
- "read" : {
- "out" : <num>,
- "available" : <num>,
- "totalTickets" : <num>
- }
- }
- },
New in version 3.0.
A string. For internal use by MongoDB.
New in version 3.0.
A document that returns statistics on the LSM (Log-Structured Merge)tree. The values reflects the statistics for all LSM trees used inthis server.
New in version 3.0.
A document that returns statistics related to the asynchronousoperations API. This is unused by MongoDB.
New in version 3.0.
A document that returns statistics on the block manager operations.
New in version 3.0: A document that returns statistics on the cache and page evictionsfrom the cache.
The following describes some of the keywiredTiger.cache
statistics:
wiredTiger.cache.
maximum bytes configured
Maximum cache size.
Size in byte of the data currently in cache. This value shouldnot be greater than the
maximum bytes configured
value.Main statistics for page eviction.
Size in bytes of the dirty data in the cache. This value shouldbe less than the
bytes currently in the cache
value.Number of pages read into the cache.
wiredTiger.cache.pages read into cache
withthewiredTiger.cache.pages written fromcache
can provide an overview of the I/O activity.- Number of pages written from the cache.
wiredTiger.cache.pages written from cache
with thewiredTiger.cache.pages read intocache
can provide an overview of the I/O activity.
To adjust the size of the WiredTiger internal cache, seestorage.wiredTiger.engineConfig.cacheSizeGB
and—wiredTigerCacheSizeGB
. Avoid increasing the WiredTigerinternal cache size above its default value.
New in version 3.0.
A document that returns statistics related to WiredTiger connections.
New in version 3.0.
A document that returns statistics on WiredTiger cursor.
New in version 3.0.
A document that returns statistics on the data handles and sweeps.
New in version 3.0.
A document that returns statistics on WiredTiger’s write ahead log(i.e. the journal).
See also
Journaling and the WiredTiger Storage Engine
New in version 3.0.
A document that returns statistics on the reconciliation process.
New in version 3.0.
A document that returns the open cursor count and open session countfor the session.
New in version 3.0.
A document that returns statistics on yields during pageacquisitions.
New in version 3.0.
A document that returns statistics on transaction checkpoints andoperations.
wiredTiger.transaction.
transaction checkpoint most recent time
- Amount of time, in milliseconds, to create the most recentcheckpoint. An increase in this value under stead write load mayindicate saturation on the I/O subsystem.
New in version 3.0.
A document that returns information on the number of concurrent ofread and write transactions allowed into the WiredTiger storageengine. These settings are MongoDB-specific.
To change the settings for concurrentreads and write transactions, seewiredTigerConcurrentReadTransactions
andwiredTigerConcurrentWriteTransactions
.
writeBacksQueued
- "writeBacksQueued" : <boolean>,
writeBacksQueued
- A boolean that indicates whether there are operations from a
mongos
instance queued for retrying. Typically, thisvalue is false. See also writeBacks.
mem
- "mem" : {
- "bits" : <int>,
- "resident" : <int>,
- "virtual" : <int>,
- "supported" : <boolean>,
- "mapped" : <int>,
- "mappedWithJournal" : <int>
- },
mem
- A document that reports on the system architecture of the
mongod
and current memory use.
mem.
bits
- A number, either
64
or32
, that indicates whether theMongoDB instance is compiled for 64-bit or 32-bit architecture.
mem.
resident
- The value of
mem.resident
is roughly equivalent tothe amount of RAM, in mebibyte (MiB), currently used by the databaseprocess. During normal use, this value tends to grow. In dedicateddatabase servers, this number tends to approach the total amount ofsystem memory.
mem.
virtual
mem.virtual
displays the quantity, in mebibyte(MiB), of virtual memory used by themongod
process.
mem.
supported
- A boolean that indicates whether the underlying system supportsextended memory information. If this value is false and the systemdoes not support extended memory information, then other
mem
values may not be accessible to the databaseserver.
mem.
note
- The field
mem.note
appears ifmem.supported
is false.
The mem.note
field contains the text: "not all meminfo support on this platform"
.
metrics
- "metrics" : {
- "commands": {
- "<command>": {
- "failed": <num>,
- "total": <num>
- }
- },
- "cursor" : {
- "timedOut" : NumberLong(<num>),
- "open" : {
- "noTimeout" : NumberLong(<num>),
- "pinned" : NumberLong(<num>),
- "multiTarget" : NumberLong(<num>),
- "singleTarget" : NumberLong(<num>),
- "total" : NumberLong(<num>),
- }
- },
- "document" : {
- "deleted" : NumberLong(<num>),
- "inserted" : NumberLong(<num>),
- "returned" : NumberLong(<num>),
- "updated" : NumberLong(<num>)
- },
- "getLastError" : {
- "wtime" : {
- "num" : <num>,
- "totalMillis" : <num>
- },
- "wtimeouts" : NumberLong(<num>)
- },
- "operation" : {
- "scanAndOrder" : NumberLong(<num>),
- "writeConflicts" : NumberLong(<num>)
- },
- "queryExecutor": {
- "scanned" : NumberLong(<num>),
- "scannedObjects" : NumberLong(<num>)
- },
- "record" : {
- "moves" : NumberLong(<num>)
- },
- "repl" : {
- "executor" : {
- "pool" : {
- "inProgressCount" : <num>
- },
- "queues" : {
- "networkInProgress" : <num>,
- "sleepers" : <num>
- },
- "unsignaledEvents" : <num>,
- "shuttingDown" : <boolean>,
- "networkInterface" : <string>
- },
- "apply" : {
- "attemptsToBecomeSecondary" : <NumberLong>,
- "batches" : {
- "num" : <num>,
- "totalMillis" : <num>
- },
- "ops" : <NumberLong>
- },
- "buffer" : {
- "count" : <NumberLong>,
- "maxSizeBytes" : <NumberLong>,
- "sizeBytes" : <NumberLong>
- },
- "initialSync" : {
- "completed" : <NumberLong>,
- "failedAttempts" : <NumberLong>,
- "failures" : <NumberLong>,
- },
- "network" : {
- "bytes" : <NumberLong>,
- "getmores" : {
- "num" : <num>,
- "totalMillis" : <num>
- },
- "notMasterLegacyUnacknowledgedWrites" : <NumberLong>,
- "notMasterUnacknowledgedWrites" : <NumberLong>,
- "ops" : <NumberLong>,
- "readersCreated" : <NumberLong>
- },
- "stepDown" : {
- "userOperationsKilled" : <NumberLong>,
- "userOperationsRunning" : <NumberLong>
- }
- },
- "storage" : {
- "freelist" : {
- "search" : {
- "bucketExhausted" : <num>,
- "requests" : <num>,
- "scanned" : <num>
- }
- }
- },
- "ttl" : {
- "deletedDocuments" : NumberLong(<num>),
- "passes" : NumberLong(<num>)
- }
- },
metrics
- A document that returns various statistics that reflect the currentuse and state of a running
mongod
instance.
New in version 3.0.
A document that reports on the use of database commands. The fieldsin metrics.commands
are the names of databasecommands. For each command, theserverStatus
reports the total number of executions andthe number of failed executions.
Starting in MongoDB 4.0.13 and 4.2.1,metrics.commands
includereplSetStepDownWithForce
(i.e. the replSetStepDown
command with force: true
) as well as the overallreplSetStepDown
. In earlier versions, the commandreported only overall replSetStepDown
metrics.
metrics.commands.<command>.
failed
- The number of times
<command>
failed on thismongod
.
metrics.commands.<command>.
total
- The number of times
<command>
executed on thismongod
.
metrics.
document
- A document that reflects document access and modification patterns.Compare these values to the data in the
opcounters
document, which track total number of operations.
New in version 3.2.
A document that reports on various statistics for the replicationexecutor.
metrics.
getLastError
- A document that reports on
getLastError
use.
metrics.getLastError.
wtime
- A document that reports
getLastError
operation countswith aw
argument greater than1
.
metrics.getLastError.wtime.
num
- The total number of
getLastError
operations with aspecified write concern (i.e.w
) that wait for one or moremembers of a replica set to acknowledge the write operation (i.e. aw
value greater than1
.)
metrics.getLastError.wtime.
totalMillis
- The total amount of time in milliseconds that the
mongod
has spent performinggetLastError
operations with writeconcern (i.e.w
) that wait for one or more members of a replicaset to acknowledge the write operation (i.e. aw
value greaterthan1
.)
metrics.getLastError.
wtimeouts
- The number of times that write concern operations have timedout as a result of the
wtimeout
threshold togetLastError
.
metrics.
operation
- A document that holds counters for several types of update and queryoperations that MongoDB handles using special operation types.
metrics.operation.
scanAndOrder
- The total number of queries that return sorted numbers that cannotperform the sort operation using an index.
metrics.queryExecutor.
scanned
- The total number of index items scanned during queries andquery-plan evaluation. This counter is the same as
totalKeysExamined
in the output ofexplain()
.
metrics.queryExecutor.
scannedObjects
- The total number of documents scanned during queries and query-planevaluation. This counter is the same as
totalDocsExamined
in the output ofexplain()
.
metrics.
record
- A document that reports on data related to record allocation in theon-disk memory files.
metrics.
repl
- A document that reports metrics related to the replication process.
metrics.repl
document appears on allmongod
instances, even those that aren’t members ofreplica sets.
metrics.repl.
apply
- A document that reports on the application of operations from thereplication oplog.
New in version 4.0.6: (Also available in 3.6.11+)
The total number of oplog operations applied. Themetrics.repl.apply.batchSize
is incremented with thenumber of operations in a batch at the batch boundaries instead ofbeing incremented by one after each operation.
For finer granularity, see metrics.repl.apply.ops
.
metrics.repl.apply.
batches
metrics.repl.apply.batches
reports on theoplog application process on secondariesmembers of replica sets. SeeMultithreaded Replication for moreinformation on the oplog application processes
metrics.repl.apply.batches.
totalMillis
- The total amount of time in milliseconds the
mongod
hasspent applying operations from the oplog.
metrics.repl.apply.
ops
- The total number of oplog operations applied.
metrics.repl.apply.ops
is incremented after eachoperation.
See also
metrics.repl.
buffer
- MongoDB buffers oplog operations from the replication sync sourcebuffer before applying oplog entries in abatch.
metrics.repl.buffer
provides a way totrack the oplog buffer. SeeMultithreaded Replication for moreinformation on the oplog application process.
metrics.repl.buffer.
maxSizeBytes
- The maximum size of the buffer. This value is a constant setting inthe
mongod
, and is not configurable.
metrics.repl.
network
metrics.repl.network
reports network use bythe replication process.
metrics.repl.network.
bytes
metrics.repl.network.bytes
reports the totalamount of data read from the replication sync source.
metrics.repl.network.
getmores
metrics.repl.network.getmores
reports on thegetmore
operations, which are requests for additional resultsfrom the oplog cursor as part of the oplog replicationprocess.
metrics.repl.network.getmores.
num
metrics.repl.network.getmores.num
reports thetotal number ofgetmore
operations, which are operations thatrequest an additional set of operations from the replication syncsource.
metrics.repl.network.getmores.
totalMillis
metrics.repl.network.getmores.totalMillis
reports the total amount of time required to collect data fromgetmore
operations.
Note
This number can be quite large, as MongoDB will wait for moredata even if the getmore
operation does not initial returndata.
metrics.repl.network.
notMasterLegacyUnacknowledgedWrites
- The number of unacknowledged (
w: 0
) legacy write operations (seeRequest Opcodes) that failed because the currentmongod
is not inPRIMARY
state.
New in version 4.2.
metrics.repl.network.
notMasterUnacknowledgedWrites
- The number of unacknowledged (
w: 0
) write operations that failedbecause the currentmongod
is not inPRIMARY
state.
New in version 4.2.
metrics.repl.network.
readersCreated
- The total number of oplog query processes created. MongoDB willcreate a new oplog query any time an error occurs in theconnection, including a timeout, or a networkoperation. Furthermore,
metrics.repl.network.readersCreated
willincrement every time MongoDB selects a new source for replication.
metrics.repl.
stepDown
- Information on user operations that were running when the
mongod
stepped down.
New in version 4.2.
metrics.repl.stepDown.
userOperationsKilled
- The number of user operations killed when the
mongod
stepped down.
New in version 4.2.
metrics.repl.stepDown.
userOperationsRunning
- The number of user operations that remained running when the
mongod
stepped down.
New in version 4.2.
metrics.storage.freelist.search.
bucketExhausted
- The number of times that
mongod
has checked the free listwithout finding a suitably large record allocation.
metrics.storage.freelist.search.
requests
- The number of times
mongod
has searched for availablerecord allocations.
metrics.storage.freelist.search.
scanned
- The number of available record allocations
mongod
hassearched.
metrics.
ttl
- A document that reports on the operation of the resource use of thettl index process.
metrics.ttl.
deletedDocuments
- The total number of documents deleted from collections with attl index.
metrics.ttl.
passes
- The number of times the background process removes documents fromcollections with a ttl index.
New in version 2.6.
A document that contains data regarding cursor state and use.
New in version 2.6.
The total number of cursors that have timed out since the serverprocess started. If this number is large or growing at a regularrate, this may indicate an application error.
New in version 2.6.
A document that contains data regarding open cursors.
New in version 2.6.
The number of open cursors with the optionDBQuery.Option.noTimeout
set to prevent timeout after aperiod of inactivity.
New in version 2.6.
The number of “pinned” open cursors.
New in version 2.6.
The number of cursors that MongoDB is maintaining for clients.Because MongoDB exhausts unused cursors, typically this value smallor zero. However, if there is a queue, stale tailable cursors, or alarge number of operations this value may rise.
New in version 3.0.
The total number of cursors that only target a single shard. Onlymongos
instances reportmetrics.cursor.open.singleTarget
values.
New in version 3.0.
The total number of cursors that only target more than one shard.Only mongos
instances reportmetrics.cursor.open.multiTarget
values.
watchdog
New in version 3.6.
- "watchdog" : {
- "checkGeneration" : NumberLong(<num>),
- "monitorGeneration" : NumberLong(<num>),
- "monitorPeriod" : <num>
- }
Note
The watchdog
section is only present if the Storage Node Watchdog is enabled.
watchdog
- A document reporting the status of theStorage Node Watchdog.
watchdog.
checkGeneration
- The number of times the directories have been checked since startup.Directories are checked multiple times every
monitoringPeriod
.
watchdog.
monitorGeneration
- The number of times the status of all filesystems used by
mongod
has been checked. This is incremented once everymonitoringPeriod
.
watchdog.
monitorPeriod
- The value set by
watchdogPeriodSeconds
. This represents theperiod in between status checks.
Output Changelog
- Starting in MongoDB 4.2.1 (and 4.0.13),
serverStatus
includes:electionMetrics
- Starting in MongoDB 4.2,
serverStatus
:- Returns
opcounters
andopcountersRepl
metrics as 64-bit integers (i.e.NumberLong) instead of 32-bit integers (i.e. NumberInt). - Includes
trafficRecording
metrics in its output. - Added new document count (
countDocs
) metrics inshardingStatistics
. - Added new unacknowledged writes counts to
metrics.repl.network
. - Added new user operations counts to
metrics.repl.stepDown
. - Added new transaction metrics in
transactions
formongod
. - Includes
transactions
metrics formongos
. - Added
sessionCatalogSize
metric tologicalSessionRecordCache
. - Added
countDonorMoveChunkLockTimeout
metric toshardingStatistics
. - Added
ReplicationStateTransition
lock information tolocks
. - Reports
ParallelBatchWriterMode
lock information separately fromGlobal
lock information. Seelocks
.
- Returns
- Starting in MongoDB 4.0.6,
serverStatus
includes:opReadConcernCounters
opWriteConcernCounters
(RequiresreportOpWriteConcernCountersInServerStatus
parameterset totrue
).metrics.repl.apply.batchSize
- Starting in MongoDB 4.0,
serverStatus
includesshardingStatistics
in its output. - Starting in MongoDB 3.6,
serverStatus
no longer outputs therangeDeleter
section. - Starting in MongoDB 3.0,
serverStatus
no longer outputs theworkingSet
,indexCounters
, andrecordStats
sections.