- Reference >
- Database Commands >
- Diagnostic Commands >
- serverStatus
serverStatus¶
On this page
Definition¶
-
serverStatus
¶ The
serverStatus
command 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.
Syntax¶
The command has the following syntax:
The value (i.e. 1
above) does not affect the operation of the
command. The db.serverStatus()
command returns a large amount of
data. To return a specific object or field from the output append the
object or field name to the command.
For example:
The mongo
shell provides the db.serverStatus()
wrapper for the serverStatus
command.
See also
Much of the output of serverStatus
is also displayed
dynamically by mongostat
. See the
mongostat command for more information.
Behavior¶
By default, serverStatus
excludes in its output some content in
the repl document.
To include fields that are excluded by default, specify the top-level
field and set it to 1
in the command. To exclude fields that are
included by default, specify the top-level field and set to 0
in
the command.
For example, the following operation suppresses the repl
,
metrics
and locks
information in the output.
The following example includes all repl information in the output:
Initialization¶
The statistics reported by serverStatus
are reset when the
mongod
server is restarted.
This command will always return a value, even on a fresh database. The
related command db.serverStatus()
does not always return a
value unless a counter has started to increment for a particular
metric.
After you run an update query, db.serverStatus()
and
db.runCommand({ serverStatus: 1})
both return the same values.
Change tcmalloc
Verbosity¶
By default, tcmalloc
information is included in the output. This
section provides memory allocation statistics for your database. To
change the verbosity of the tcmalloc
section, specify an integer
between 0
and 2
(inclusive):
The command has the following behavior:
- By default,
tcmalloc
is set to1
. - Passing a larger integer value increases the verbosity.
- Passing
0
orfalse
omits thetcmalloc
section from the output. - Passing any other input results in the default setting.
For more information about how MongoDB allocates memory, see TCMalloc.
Output¶
Note
The output fields vary depending on the version of MongoDB,
underlying operating system platform, the storage engine, and the
kind of node, including mongos
, mongod
or
replica set member.
For the serverStatus
output specific to the version of
your MongoDB, refer to the appropriate version of the MongoDB Manual.
indexBulkBuilder¶
-
indexBulkBuilder
¶ Provides metrics for index bulk builder operations. Use these metrics to diagnose index build issues with
createIndexes
, collection cloning during initial sync, index builds that resume after startup, and statistics on disk usage by the external sorter.
-
indexBulkBuilder.
count
¶ The number of instances of the bulk builder created.
-
indexBulkBuilder.
filesClosedForExternalSort
¶ The number of times the external sorter closed a file handle to spill data to disk. Combine this value with
filesOpenedForExternalSort
to determine the number of open file handles in use by the external sorter.
-
indexBulkBuilder.
filesOpenedForExternalSort
¶ The number of times the external sorter opened a file handle to spill data to disk. Combine this value with
filesClosedForExternalSort
to determine the number of open file handles in use by the external sorter.
-
indexBulkBuilder.
resumed
¶ The number of times the bulk builder was created for a resumable index build.
Instance Information¶
-
host
¶ The system’s hostname. In Unix/Linux systems, this should be the same as the output of the
hostname
command.
-
advisoryHostFQDNs
¶ An array of the system’s fully qualified domain names (FQDNs).
-
version
¶ The MongoDB version of the current MongoDB process.
-
pid
¶ The process ID number.
-
uptime
¶ The number of seconds that the current MongoDB process has been active.
-
uptimeMillis
¶ The number of milliseconds that the current MongoDB process has been active.
-
uptimeEstimate
¶ The uptime in seconds as calculated from MongoDB’s internal course-grained time keeping system.
-
localTime
¶ The ISODate representing the current time, according to the server, in UTC.
asserts¶
-
asserts
¶ A document that reports on the number of assertions raised since the MongoDB process started. While assert errors are typically uncommon, if there are non-zero values for the
asserts
, you should check the log file for more information. In many cases, these errors are trivial, but are worth investigating.
-
asserts.
regular
¶ The number of regular assertions raised since the MongoDB process started. Check the log file for more information about these messages.
-
asserts.
warning
¶ This field always returns zero
0
.
-
asserts.
msg
¶ The number of message assertions raised since the MongoDB process started. Check the log file for more information about these messages.
-
asserts.
user
¶ The number of “user asserts” that have occurred since the last time the MongoDB process started. These are errors that user may generate, such as out of disk space or duplicate key. You can prevent these assertions by fixing a problem with your application or deployment. Check the MongoDB log for more information.
connections¶
-
connections
¶ A document that reports on the status of the connections. Use these values to assess the current load and capacity requirements of the server.
-
connections.
current
¶ The number of incoming connections from clients to the database server . This number includes the current shell session. Consider the value of
connections.available
to add more context to this datum.The value will include all incoming connections including any shell connections or connections from other servers, such as replica set members or
mongos
instances.
-
connections.
available
¶ The number of unused incoming connections available. Consider this value in combination with the value of
connections.current
to understand the connection load on the database, and the UNIX ulimit Settings document for more information about system thresholds on available connections.
-
connections.
totalCreated
¶ Count of all incoming connections created to the server. This number includes connections that have since closed.
-
connections.
active
¶ The number of active client connections to the server. Active client connections refers to client connections that currently have operations in progress.
electionMetrics¶
New in version 4.2.1.
The electionMetrics
section provides information on elections
called by this mongod
instance in a bid to become the
primary:
-
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 elections called and the number of elections that succeeded.New in version 4.2.1.
-
electionMetrics.
priorityTakeover
¶ Metrics on elections that were called by the
mongod
instance because itspriority
is higher than the primary’s.The
electionMetrics.priorityTakeover
includes both the number of elections called and the number of elections that succeeded.New in version 4.2.1.
-
electionMetrics.
catchUpTakeover
¶ Metrics on elections called by the
mongod
instance because it is more-up-to-date than the primary.The
catchUpTakeover
includes both the number of elections called and the number of elections that succeeded.See also
New in version 4.2.1.
-
electionMetrics.
electionTimeout
¶ Metrics on elections called by the
mongod
instance because it has not been able to reach the primary withinsettings.electionTimeoutMillis
.The
electionTimeout
includes both the number of elections called and the number of elections that succeeded.See also
New in version 4.2.1.
-
electionMetrics.
freezeTimeout
¶ Metrics on elections called by the
mongod
instance after itsfreeze period
(during which the member cannot seek an election) has expired.The
electionMetrics.freezeTimeout
includes both the number of elections called and the number of elections that succeeded...versionadded:: 4.2.1
-
electionMetrics.
numStepDownsCausedByHigherTerm
¶ Number of times the
mongod
instance stepped down because it saw a higher term (i.e. other member/members have participated in additional elections).New in version 4.2.1.
-
electionMetrics.
numCatchUps
¶ Number of elections where the
mongod
instance as the newly-elected primary had to catch up to the highest known oplog entry.New in version 4.2.1.
-
electionMetrics.
numCatchUpsSucceeded
¶ Number of times the
mongod
instance as the newly-elected primary successfully caught up to the highest known oplog entry.New in version 4.2.1.
-
electionMetrics.
numCatchUpsAlreadyCaughtUp
¶ Number of times the
mongod
instance as the newly-elected primary concluded its catchup process because it was already caught up when electedNew in version 4.2.1.
-
electionMetrics.
numCatchUpsSkipped
¶ Number of times the
mongod
instance as the newly-elected primary skipped the catchup process.New in version 4.2.1.
-
electionMetrics.
numCatchUpsTimedOut
¶ Number of times the
mongod
instance as the newly-elected primary concluded its catchup process because of thesettings.catchUpTimeoutMillis
limit.New in version 4.2.1.
-
electionMetrics.
numCatchUpsFailedWithError
¶ Number of times the newly-elected primary’s catchup process failed with an error.
New in version 4.2.1.
-
electionMetrics.
numCatchUpsFailedWithNewTerm
¶ Number of times the newly-elected primary’s catchup process concluded because another member(s) had a higher term (i.e. other member/members have participated in additional elections).
New in version 4.2.1.
-
electionMetrics.
numCatchUpsFailedWithReplSetAbortPrimaryCatchUpCmd
¶ Number of times the newly-elected primary’s catchup process concluded because the
mongod
received thereplSetAbortPrimaryCatchUp
command.New in version 4.2.1.
-
electionMetrics.
averageCatchUpOps
¶ Average number of operations applied during the newly-elected primary’s catchup processes.
New in version 4.2.1.
extra_info¶
-
extra_info
¶ A document that provides additional information regarding the underlying system.
-
extra_info.
note
¶ A string with the text
"fields vary by platform."
-
extra_info.
page_faults
¶ The total number of page faults. The
extra_info.page_faults
counter 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 draws a distinction between “hard” page faults involving disk I/O, and “soft” page faults that only require moving pages in memory. MongoDB counts both hard and soft page faults in this statistic.
flowControl¶
New in version 4.2.
-
flowControl
¶ A document that returns statistics on the Flow Control. With flow control enabled, as the
majority commit
point lag grows close to theflowControlTargetLagSeconds
, writes on the primary must obtain tickets before taking locks. As such, the metrics returned are meaningful when run on the primary.New in version 4.2.
-
flowControl.
enabled
¶ A boolean that indicates whether Flow Control is enabled(
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 be acquired 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 waited to 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 taken per 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 per second 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 flow control has engaged. Flow control engages when the majority committed 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 engaged since the last restart. Flow control engages when the majority 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.
-
flowControl.
isLaggedTimeMicros
¶ When run on the primary, the amount of time flow control has spent being engaged since the last restart. Flow control engages when the majority 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
¶ A document that reports on the free Cloud monitoring.
-
freeMonitoring.
state
¶ The enablement state of free monitoring. The values can be one of the following:
- “enabled”
- “disabled”
- “pending” if the enable free monitoring encountered a registeration error.
-
freeMonitoring.
retryIntervalSecs
¶ The frequency, in seconds, at which data is uploaded.
-
freeMonitoring.
lastRunTime
¶ The date and time of the last run of the metrics upload.
-
freeMonitoring.
registerErrors
¶ The number of registration errors, incremented on unexpected HTTP status or network errors.
-
freeMonitoring.
metricsErrors
¶ The number of errors encountered when uploading metrics.
globalLock¶
-
globalLock
¶ A document that reports on the database’s lock state.
Generally, the locks document provides more detailed data on lock uses.
-
globalLock.
totalTime
¶ The time, in microseconds, since the database last started and created the
globalLock
. This is roughly equivalent to total server uptime.
-
globalLock.
currentQueue
¶ A document that provides information concerning the number of operations 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. The
globalLock.activeClients
readers and writers information provides context for this data.
-
globalLock.currentQueue.
readers
¶ The number of operations that are currently queued and waiting for the read lock. A consistently small read-queue, particularly of shorter operations, should cause no concern.
-
globalLock.currentQueue.
writers
¶ The number of operations that are currently queued and waiting for the write lock. A consistently small write-queue, particularly of shorter operations, is no cause for concern.
-
globalLock.
activeClients
¶ A document that provides information about the number of connected clients and the read and write operations performed by these clients.
Use this data to provide context for the
globalLock.currentQueue
data.
-
globalLock.activeClients.
total
¶ The total number of internal client connections to the database including 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 read operations.
-
globalLock.activeClients.
writers
¶ The number of active client connections performing write operations.
logicalSessionRecordCache¶
New in version 3.6.
-
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 last refresh period.See also
$listLocalSessions
logicalSessionRefreshMillis
logicalSessionRefreshMinutes
-
logicalSessionRecordCache.
sessionsCollectionJobCount
¶ The number that tracks the number of times the refresh process has run 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 record cleanup process has run on the
config.transactions
collection.
-
logicalSessionRecordCache.
lastTransactionReaperJobDurationMillis
¶ The length (in milliseconds) 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
collection that 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 writes
or 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 had
transactions within the most recent
localLogicalSessionTimeoutMinutes
interval.
- For a
New in version 4.2.
locks¶
-
locks
¶ A document that reports for each lock
<type>
, data on lock<modes>
.The possible lock
<types>
are:Lock Type Description ParallelBatchWriterMode
Represents a lock for parallel batch writer mode.
In earlier versions, PBWM information was reported as part of the
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 Mode Description R
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>.
acquireCount
¶ Number of times the lock was acquired in the specified mode.
-
locks.<type>.
acquireWaitCount
¶ Number of times the
locks.acquireCount
lock acquisitions encountered waits because the locks were held in a conflicting mode.
-
locks.<type>.
timeAcquiringMicros
¶ Cumulative wait time in microseconds for the lock acquisitions.
locks.timeAcquiringMicros
divided bylocks.acquireWaitCount
gives an approximate average wait time for the particular lock mode.
-
locks.<type>.
deadlockCount
¶ Number of times the lock acquisitions encountered deadlocks.
network¶
-
network
¶ A document that reports data on MongoDB’s network use. These statistics measure ingress connections only, i.e. traffic seen by the
mongod
/mongos
over network connections initiated by clients or othermongod
/mongos
instances. Traffic from network connections initiated by thismongod
/mongos
instance (i.e. egress connections) is not measured in these statistics.
-
network.
bytesIn
¶ The total number of bytes that the server has received over network connections initiated by clients or other
mongod
/mongos
instances.
-
network.
bytesOut
¶ The total number of bytes that the server has sent over network connections initiated by clients or other
mongod
/mongos
instances.
-
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 consistent with expectations and application use.
opLatencies¶
Only for ``mongod`` instances
-
opLatencies
¶ A document containing operation latencies for the instance as a whole. See latencyStats Document for an description of this document.
Only
mongod
instances reportopLatencies
.
-
opLatencies.
reads
¶ Latency statistics for read requests.
-
opLatencies.
writes
¶ Latency statistics for write operations.
-
opLatencies.
commands
¶ Latency statistics for database commands.
opReadConcernCounters¶
New in version 4.0.6.
Only for mongod instances
-
opReadConcernCounters
¶ New in version 4.0.6.
A document that reports on the read concern level specified by query operations to the
mongod
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 read concern level "local"
."majority"
Number of query operations that specified read concern level "majority"
."snapshot"
Number of query operations that specified read concern level "snapshot"
."none"
Number of query operations that did not specify a read concern level and instead used the default read concern level. The sum of the
opReadConcernCounters
equalsopcounters.query
.
opWriteConcernCounters¶
Only for mongod instances
-
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: <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.Note
Only available when
reportOpWriteConcernCountersInServerStatus
parameter is set totrue
(false
by default).
-
opWriteConcernCounters.
insert
¶ A document that reports on the w: <value> specified by insert operations to the
mongod
instance since it last started:Note
Only available when
reportOpWriteConcernCountersInServerStatus
parameter is set totrue
(false
by default).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 the specific<tag>
."none"
Number of insert operations that did not specify w
value. These operations use the defaultw
value of1
.The sum of the
opWriteConcernCounters.insert
equalsopcounters.insert
.
-
opWriteConcernCounters.
update
¶ A document that reports on the w: <value> specified by update operations to the
mongod
instance since it last started:Note
Only available when
reportOpWriteConcernCountersInServerStatus
parameter is set totrue
(false
by default).Description "wmajority"
Number of update operations that specified w: "majority"
."wnum"
Number of update operations that specified w: <num>
. The counts are grouped by the specific<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 defaultw
value of1
.The sum of the
opWriteConcernCounters.update
equalsopcounters.update
.
-
opWriteConcernCounters.
delete
¶ A document that reports on the w: <value> specified by delete operations to the
mongod
instance since it last started:Note
Only available when
reportOpWriteConcernCountersInServerStatus
parameter is set totrue
(false
by default).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 the specific<tag>
."none"
Number of delete operations that did not specify w
value. These operations use the defaultw
value of1
.The sum of the
opWriteConcernCounters.delete
equalsopcounters.delete
.
opcounters¶
Starting in MongoDB 4.2, the returned opcounters.* values are type NumberLong. In previous versions, the values are of type NumberInt.
-
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 these values over time to track database utilization.
Note
The data in
opcounters
treats operations that affect multiple documents, such as bulk insert or multi-update operations, as a single operation. Seemetrics.document
for more granular document-level operation tracking.Additionally, these values reflect received operations, and increment 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 are type 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 are type 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 are type 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 are type 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 query count is low. Secondary nodes sendgetMore
operations as part of the replication process.Starting in MongoDB 4.2, the returned opcounters.* values are type 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 commands except the write commands:insert
,update
, anddelete
.Starting in MongoDB 4.2, the returned opcounters.* values are type NumberLong. In previous versions, the values are of type NumberInt.
-
opcounters.
deprecated
¶ This section only appears in the
db.serverStatus()
output when one of the following, deprecated opcodes has been used:These opcodes were deprecated in MongoDB 4.2.15 and support for these opcodes is removed in MongoDB 5.1. Starting in MongoDB 5.1,
mongod
refuses requests that use a deprecated opcode and increments the corresponding counter.OP_QUERY
is an exception to the general rule.mongod
continues to supporthello
andisMaster
requests that useOP_QUERY
.mongod
refuses any otherOP_QUERY
requests.The counters are reset when
mongod
starts.
opcountersRepl¶
Starting in MongoDB 4.2, the returned opcountersRepl.* values are type NumberLong. In previous versions, the values are type NumberInt.
-
opcountersRepl
¶ A document that reports on database replication operations by type since the
mongod
instance last started.These values only appear when the current host is a member of a replica set.
These values will differ from the
opcounters
values because 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 until next restart. Analyze these values over time to track database utilization.
Starting in MongoDB 4.2, the returned opcountersRepl.* values are type 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 are type 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 are type 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 are type 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 are type 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 query count is low. Secondary nodes sendgetMore
operations as part of the replication process.Starting in MongoDB 4.2, the returned opcountersRepl.* values are type NumberLong. In previous versions, the values are type NumberInt.
oplogTruncation¶
-
oplogTruncation
¶ New in version 4.2.1: For WiredTiger storage engine
A document that reports on oplog truncations.
The field only appears when the current instance is a member of a replica set and uses WiredTiger Storage Engine.
-
oplogTruncation.
totalTimeProcessingMicros
¶ New in version 4.2.1.
The total time taken, in microseconds, to scan or sample the oplog to determine the oplog truncation points.
-
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"
.
-
oplogTruncation.
totalTimeTruncatingMicros
¶ New in version 4.2.1.
The cumulative time spent, in microseconds, performing oplog truncations.
-
oplogTruncation.
truncateCount
¶ New in version 4.2.1.
The cumulative number of oplog truncations.
repl¶
-
repl
¶ A document that reports on the replica set configuration.
repl
only appear when the current host is a replica set. See Replication for more information on replication.
-
repl.
hosts
¶ An array of the current replica set members’ hostname and port information (
"host:port"
).
-
repl.
setName
¶ A string with the name of the current replica set. This value reflects the
--replSet
command line argument, orreplSetName
value in the configuration file.
-
repl.
secondary
¶ A boolean that indicates whether the current node is a secondary member of the replica set.
-
repl.
primary
¶ The hostname and port information (
"host:port"
) of the current primary member of the replica set.
-
repl.
me
¶ The hostname and port information (
"host:port"
) for the current member of the replica set.
-
repl.
rbid
¶ Rollback identifier. Used to determine if a rollback has happened for this
mongod
instance.
-
repl.
replicationProgress
¶ An array with one document for each member of the replica set that reports replication process to this member. Typically this is the primary, or secondaries if using chained replication.
To include this output, you must pass the
repl
option to theserverStatus
, as in the following:The content of the
repl.replicationProgress
section 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].
rid
¶ An ObjectId used as an ID for the members of the replica set. For internal use only.
-
repl.replicationProgress[n].
optime
¶ Information regarding the last operation from the oplog that the member applied, as reported from this member.
-
repl.replicationProgress[n].
host
¶ The name of the host in
[hostname]:[port]
format for the member of the replica set.
-
repl.replicationProgress[n].
memberID
¶ The integer identifier for this member of the replica set.
security¶
-
security
¶ A document that reports on security configuration and details; specifically, this section reports on the
mongod
/mongos
instance’s TLS/SSL certificate.The
security
information only appears formongod
instances andmongos
instances with support for TLS/SSL.-
security.
SSLServerSubjectName
¶ The subject name associated with the
mongod
/mongos
instance’s TLS/SSL certificate.
-
security.
SSLServerHasCertificateAuthority
¶ A boolean that is:
-
sharding¶
-
sharding
¶ A document with data regarding the sharded cluster. The
lastSeenConfigServerOpTime
is present only for amongos
or a shard member, not for a config server.
-
sharding.
configsvrConnectionString
¶ The connection string for the config servers.
-
sharding.
lastSeenConfigServerOpTime
¶ The latest optime of the CSRS primary that the mongos or the shard member has seen. The optime document includes:
ts
, the Timestamp of the operation.t
, theterm
in which the operation was originally generated on the primary.
The
lastSeenConfigServerOpTime
is present only if the sharded cluster uses CSRS.
-
sharding.
maxChunkSizeInBytes
¶ New in version 3.6.
The maximum size limit for a chunk. If the chunk size has been updated recently on the config server, the
maxChunkSizeInBytes
may not reflect the most recent value.
shardingStatistics¶
- Shard
- mongos
When run on a member of a shard:
When run on a mongos
:
-
shardingStatistics
¶ A document which contains metrics on metadata refresh on sharded clusters.
-
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 metadata refreshes.
Only present when run on a shard.
-
shardingStatistics.
countDonorMoveChunkStarted
¶ The total number of times that the
moveChunk
command has started on the shard, of which this node is a member, as part of a chunk migration process. This increasing number does not consider whether the chunk migrations succeed or not.Only present when run on a shard.
-
shardingStatistics.
totalDonorChunkCloneTimeMillis
¶ The cumulative time, in milliseconds, taken by the clone phase of the chunk migrations from this shard, of which this node is a member. Specifically, for each migration from this shard, the tracked time starts with the
moveChunk
command and ends before the destination shard enters a catch-up phase to apply changes that occurred during the chunk migrations.Only present when run on a shard.
-
shardingStatistics.
totalCriticalSectionCommitTimeMillis
¶ The cumulative time, in milliseconds, taken by the update metadata phase of the chunk migrations from this shard, of which this node is a member. During the update metadata 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-up phase and the update metadata phase of the chunk migrations from this shard, of which this node is a member.
To calculate the duration of the catch-up phase, subtract
totalCriticalSectionCommitTimeMillis
fromtotalCriticalSectionTimeMillis
Only present when run on a shard.
-
shardingStatistics.
countDocsClonedOnRecipient
¶ Cumulative, always-increasing count of documents that have been cloned on this member where it acted as the primary of the recipient shard.
Only present when run on a shard.
New in version 4.2.
-
shardingStatistics.
countDocsClonedOnDonor
¶ Cumulative, always-increasing count of documents that haves been cloned on this member where it acted as the primary of the donor shard.
Only present when run on a shard.
New in version 4.2.
-
shardingStatistics.
countRecipientMoveChunkStarted
¶ Cumulative, always-increasing count of chunks this member, acting as the primary of the recipient shard, has started to receive (whether the 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 been deleted on this member during chunk migration where the member acted as 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 were aborted due to lock acquisition timeouts, where the member acted as the 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 the catalog cache.
-
shardingStatistics.catalogCache.
numCollectionEntries
¶ The total number of collection entries (across all databases) that are currently in the catalog cache.
-
shardingStatistics.catalogCache.
countStaleConfigErrors
¶ The total number of times that threads hit stale config exception. A stale config exception triggers a refresh of the metadata.
-
shardingStatistics.catalogCache.
totalRefreshWaitTimeMicros
¶ The cumulative time, in microseconds, that threads had to wait for a refresh of the metadata.
-
shardingStatistics.catalogCache.
numActiveIncrementalRefreshes
¶ The number of incremental catalog cache refreshes that are currently waiting 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 currently waiting 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.
-
shardingStatistics.catalogCache.
operationsBlockedByRefresh
¶ A document with statistics about operations blocked by catalog cache refresh activity on a
mongos
.Only present when run on a
mongos
.New in version 4.2.7.
-
shardingStatistics.catalogCache.operationsBlockedByRefresh.
countAllOperations
¶ The cumulative number of all operations ran on a
mongos
that were blocked at any point in their lifetime by a refresh of the catalog cache. This counter is the aggregate sum of all otheroperationsBlockedByRefresh
metrics tracked below.Only present when run on a
mongos
.New in version 4.2.7.
-
shardingStatistics.catalogCache.operationsBlockedByRefresh.
countInserts
¶ The cumulative number of insert operations ran on a
mongos
that were blocked at any point in their lifetime by a refresh of the catalog cache.Only present when run on a
mongos
.New in version 4.2.7.
-
shardingStatistics.catalogCache.operationsBlockedByRefresh.
countQueries
¶ The cumulative number of query operations ran on a
mongos
that were blocked at any point in their lifetime by a refresh of the catalog cache.Only present when run on a
mongos
.New in version 4.2.7.
-
shardingStatistics.catalogCache.operationsBlockedByRefresh.
countUpdates
¶ The cumulative number of update operations ran on a
mongos
that were blocked at any point in their lifetime by a refresh of the catalog cache.Only present when run on a
mongos
.New in version 4.2.7.
shardedIndexConsistency¶
-
shardedIndexConsistency
¶ Available only on config server instances.
A document that returns results of index consistency checks for sharded collections.
The returned metrics are meaningful only when run on the primary of the config server replica set for a version 4.2.6+ sharded cluster.
See also
enableShardedIndexConsistencyCheck
parametershardedIndexConsistencyCheckIntervalMS
parameter
New in version 4.2.6.
-
shardedIndexConsistency.
numShardedCollectionsWithInconsistentIndexes
¶ Available only on config server instances.
Number of sharded collections whose indexes are inconsistent across the shards. A sharded collection has an inconsistent index if the collection does not have the exact same indexes (including the index options) on each shard that contains chunks for the collection.
To check if a sharded collection has inconsistent indexes, see Find Inconsistent Indexes across Shards.
The returned metrics are meaningful only when run on the primary of the config server replica set for a version 4.2.6+ sharded cluster.
See also
enableShardedIndexConsistencyCheck
parametershardedIndexConsistencyCheckIntervalMS
parameter
New in version 4.2.6.
storageEngine¶
-
storageEngine
¶ A document with data about the current storage engine.
-
storageEngine.
name
¶ The name of the current storage engine.
-
storageEngine.
supportsCommittedReads
¶ New in version 3.2.
A boolean that indicates whether the storage engine supports
"majority"
read concern.
-
storageEngine.
persistent
¶ 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.
New in version 4.2.
-
transactions
¶ When run on a
mongod
, a document with data about the retryable writes and transactions.When run on a
mongos
, a document with data about the transactions run on the instance.
-
transactions.
retriedCommandsCount
¶ Available on mongod only.
The total number of retry attempts that have been received after the corresponding retryable write command has already been committed. That is, a retryable write is attempted even though the write has previously succeeded and has an associated record for the transaction and session in the
config.transactions
collection, such as when the initial write response to the client is lost.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 happen internally as part of a chunk migration.
New in version 3.6.3.
-
transactions.
retriedStatementsCount
¶ Available on mongod only.
The total number of write statements associated with the retried commands in
transactions.retriedCommandsCount
.Note
MongoDB does not re-execute the committed writes.
The total does not include any retryable writes that may happen internally as part of a chunk migration.
New in version 3.6.3.
-
transactions.
transactionsCollectionWriteCount
¶ Available on mongod only.
The total number of writes to the
config.transactions
collection, triggered when a new retryable write statement is committed.For update and delete commands, since only single document operations are retryable, there is one write per statement.
For insert operations, there is one write per batch of documents inserted, except when a failure leads to each document being inserted 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.
-
transactions.
currentActive
¶ Changed in version 4.2.1: This field is also available on mongos.
The total number of open transactions currently executing a command.
-
transactions.
currentInactive
¶ Changed in version 4.2.1: This field is also available on mongos.
The total number of open transactions that are not currently executing a command.
-
transactions.
currentOpen
¶ Changed in version 4.2.1: This field is also available on mongos.
The total number of open transactions. A transaction is opened when the first command is run as a part of that transaction, and stays open until the transaction either commits or aborts.
-
transactions.
totalAborted
¶ For the
mongod
, the total number of transactions aborted on this instance since its last startup.For the
mongos
, the total number of transactions aborted through this instance since its last startup.
-
transactions.
totalCommitted
¶ For the
mongod
, the total number of transactions committed on the instance since its last startup.For the
mongos
,the total number of transactions committed through this instance since its last startup.
-
transactions.
totalStarted
¶ For the
mongod
, the total number of transactions started on this instance since its last startup.For the
mongos
, the total number of transactions started on this instance since its last startup.
-
transactions.
abortCause
¶ Available on mongos only.
Breakdown of the
transactions.totalAborted
by cause. If a client issues an explicitabortTransaction
, the cause is listed asabort
.For example:
New in version 4.2.
-
transactions.
totalContactedParticipants
¶ Available on mongos only.
The total number of shards contacted for all transactions started through this
mongos
since its last startup.The number of shards contacted during the transaction processes can include those shards that may not be included as part of the commit.
New in version 4.2.
-
transactions.
totalParticipantsAtCommit
¶ Available on mongos only.
Total number of shards involved in the commit for all transactions started through this
mongos
since its last startup.New in version 4.2.
-
transactions.
totalRequestsTargeted
¶ Available on mongos only.
Total number of network requests targeted by the
mongos
as part of its transactions.New in version 4.2.
-
transactions.
commitTypes
¶ Available on mongos only.
Breakdown of the commits by types. For example:
The types of commit are:
Type Description noShards
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 but whose write operations only affected a single shard. readOnly
Commits of transactions that only involved read operations. twoPhaseCommit
Commits of transactions that included writes to multiple shards recoverWithToken
Commits that recovered the outcome of transactions from another instance or after this instance was restarted. For each commit type, the command returns the following metrics:
Metrics Description initiated
Total number of times that commits of this type were initiated. successful
Total number of times that commits of this type succeeded. successfulDurationMicros
Total time, in microseconds, taken by successful commits of this type. New in version 4.2.
-
transactions.
totalPrepared
¶ Available on mongod only.
The total number of transactions in prepared state on this server since the
mongod
process’s last startup.New in version 4.2.
-
transactions.
totalPreparedThenCommitted
¶ Available on mongod only.
The total number of transactions that were prepared and committed on this server since the
mongod
process’s last startup.New in version 4.2.
-
transactions.
totalPreparedThenAborted
¶ Available on mongod only.
The total number of transactions that were prepared and aborted on this server since the
mongod
process’s last startup.New in version 4.2.
-
transactions.
currentPrepared
¶ Available on mongod only.
The current number of transactions in prepared state on this server.
New in version 4.2.
-
transactions.
lastCommittedTransaction
¶ Available on mongod only.
The details of the last transaction committed when the
mongod
is primary.When returned from a secondary,
lastCommittedTransaction
returns the details of the last transaction committed when that secondary was a primary.Metrics Description operationCount
The number of write operations in the transaction. oplogOperationBytes
The size of the corresponding oplog entry or entries for the transaction. [1] writeConcern
The write concern used for the transaction. New in version 4.2.2: (Also available in 4.0.9)
[1] | Starting in version 4.2, MongoDB creates as many oplog entries as necessary to encapsulate all write operations in a transaction whereas in version 4.0, the write operations in a transaction must fit within a single oplog entry. See Oplog Size Limit for details. |
transportSecurity¶
wiredTiger¶
wiredTiger
information only appears if using the WiredTiger storage engine. Some of the statistics roll up for the server.
Note
The following is not an exhaustive list.
-
wiredTiger.
uri
¶ A string. For internal use by MongoDB.
-
wiredTiger.
async
¶ A document that returns statistics related to the asynchronous operations API. This is unused by MongoDB.
-
wiredTiger.
block-manager
¶ A document that returns statistics on the block manager operations.
-
wiredTiger.
cache
¶ A document that returns statistics on the cache and page evictions from the cache.
The following describes some of the key
wiredTiger.cache
statistics:-
wiredTiger.cache.
maximum bytes configured
¶ Maximum cache size.
-
wiredTiger.cache.
bytes currently in the cache
¶ Size in byte of the data currently in cache. This value should not be greater than the
maximum bytes configured
value.
-
wiredTiger.cache.
unmodified pages evicted
¶ Main statistics for page eviction.
-
wiredTiger.cache.
tracked dirty bytes in the cache
¶ Size in bytes of the dirty data in the cache. This value should be less than the
bytes currently in the cache
value.
-
wiredTiger.cache.
pages read into cache
¶ Number of pages read into the cache.
wiredTiger.cache.pages read into cache
with thewiredTiger.cache.pages written from cache
can provide an overview of the I/O activity.
-
wiredTiger.cache.
pages written from cache
¶ Number of pages written from the cache.
wiredTiger.cache.pages written from cache
with thewiredTiger.cache.pages read into cache
can provide an overview of the I/O activity.
To adjust the size of the WiredTiger internal cache, see
storage.wiredTiger.engineConfig.cacheSizeGB
and--wiredTigerCacheSizeGB
. Avoid increasing the WiredTiger internal cache size above its default value.-
-
wiredTiger.
connection
¶ A document that returns statistics related to WiredTiger connections.
-
wiredTiger.
cursor
¶ A document that returns statistics on WiredTiger cursor.
-
wiredTiger.
data-handle
¶ A document that returns statistics on the data handles and sweeps.
-
wiredTiger.
log
¶ A document that returns statistics on WiredTiger’s write ahead log (i.e. the journal).
-
wiredTiger.
reconciliation
¶ A document that returns statistics on the reconciliation process.
-
wiredTiger.
session
¶ A document that returns the open cursor count and open session count for the session.
-
wiredTiger.
thread-yield
¶ A document that returns statistics on yields during page acquisitions.
-
wiredTiger.
transaction
¶ A document that returns statistics on transaction checkpoints and operations.
-
wiredTiger.transaction.
transaction checkpoint most recent time
¶ Amount of time, in milliseconds, to create the most recent checkpoint. An increase in this value under stead write load may indicate saturation on the I/O subsystem.
-
-
wiredTiger.
concurrentTransactions
¶ A document that returns information on the number of concurrent of read and write transactions allowed into the WiredTiger storage engine. These settings are MongoDB-specific.
To change the settings for concurrent reads and write transactions, see
wiredTigerConcurrentReadTransactions
andwiredTigerConcurrentWriteTransactions
.
writeBacksQueued¶
-
writeBacksQueued
¶ A boolean that indicates whether there are operations from a
mongos
instance queued for retrying. Typically, this value is false. See also writeBacks.
mem¶
-
mem.
bits
¶ A number, either
64
or32
, that indicates whether the MongoDB instance is compiled for 64-bit or 32-bit architecture.
-
mem.
resident
¶ The value of
mem.resident
is 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.
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 supports extended memory information. If this value is false and the system does not support extended memory information, then other
mem
values may not be accessible to the database server.
-
mem.
note
¶ The field
mem.note
appears ifmem.supported
is false.The
mem.note
field contains the text:"not all mem info support on this platform"
.
metrics¶
-
metrics
¶ A document that returns various statistics that reflect the current use and state of a running
mongod
instance.
-
metrics.
aggStageCounters
¶ A document that reports on the use of aggregation pipeline stages. The fields in
metrics.aggStageCounters
are the names of aggregation pipeline stages. For each pipeline stage,serverStatus
reports the number of times that stage has been executed.New in version 4.2.6 (and 4.0.19).
-
metrics.operatorCounters.
match
¶ A document with a number that indicates how often match expressions ran. For some operators, the number reported is a multiple of the times the operator actually ran.
Match expression operators also increment as part of an aggregation pipeline
$match
stage. If the$match
stage uses the$expr
operator, the counter for$expr
increments, but the component counters do not increment.Consider the following query:
The counter for
$expr
increments when the query runs. The counter for$gt
does not.New in version 4.2.18.
-
metrics.
commands
¶ A document that reports on the use of database commands. The fields in
metrics.commands
are the names of database commands. For each command, theserverStatus
reports the total number of executions and the number of failed executions.Starting in MongoDB 4.0.13 and 4.2.1,
metrics.commands
includereplSetStepDownWithForce
(i.e. thereplSetStepDown
command withforce: true
) as well as the overallreplSetStepDown
. In earlier versions, the command reported only overallreplSetStepDown
metrics.
-
metrics.commands.update.
pipeline
¶ The number of times an aggregation pipeline was used to update documents on this
mongod
. Subtract this value from the total number of updates to get the number of updates made with document syntax.The
pipeline
counter is only available forupdate
andfindAndModify
operations.
-
metrics.commands.findAndModify.
pipeline
¶ The number of times
findAndModify()
was used in an aggregation pipeline to update documents on thismongod
.The
pipeline
counter is only available forupdate
andfindAndModify
operations.
-
metrics.commands.update.
arrayFilters
¶ The number of times an arrayFilter was used to update documents on this
mongod
.The
arrayFilters
counter is only available forupdate
andfindAndModify
operations.
-
metrics.commands.findAndModify.
arrayFilters
¶ The number of times an arrayFilter was used with
findAndModify()
to update documents on thismongod
.The
arrayFilters
counter is only available forupdate
andfindAndModify
operations.
-
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.
-
metrics.document.
deleted
¶ The total number of documents deleted.
-
metrics.document.
inserted
¶ The total number of documents inserted.
-
metrics.document.
returned
¶ The total number of documents returned by queries.
-
metrics.document.
updated
¶ The total number of documents updated.
-
metrics.
executor
¶ New in version 3.2.
A document that reports on various statistics for the replication executor.
-
metrics.
getLastError
¶ A document that reports on
getLastError
use.
-
metrics.getLastError.
wtime
¶ A document that reports
getLastError
operation counts with aw
argument greater than1
.
-
metrics.getLastError.wtime.
num
¶ The total number of
getLastError
operations with a specified write concern (i.e.w
) that wait for one or more members 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 write concern (i.e.w
) that wait for one or more members of a replica set to acknowledge the write operation (i.e. aw
value greater than1
.)
-
metrics.getLastError.
wtimeouts
¶ The number of times that write concern operations have timed out as a result of the
wtimeout
threshold togetLastError
.
-
metrics.
operation
¶ A document that holds counters for several types of update and query operations that MongoDB handles using special operation types.
-
metrics.operation.
scanAndOrder
¶ The total number of queries that return sorted numbers that cannot perform the sort operation using an index.
-
metrics.operation.
writeConflicts
¶ The total number of queries that encountered write conflicts.
-
metrics.
queryExecutor
¶ A document that reports data from the query execution system.
-
metrics.queryExecutor.
scanned
¶ The total number of index items scanned during queries and query-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-plan evaluation. This counter is the same as
totalDocsExamined
in the output ofexplain()
.
-
metrics.
record
¶ A document that reports on data related to record allocation in the on-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 of replica sets.
-
metrics.repl.
apply
¶ A document that reports on the application of operations from the replication oplog.
-
metrics.repl.apply.
batchSize
¶ New in version 4.0.6: (Also available in 3.6.11+)
The total number of oplog operations applied. The
metrics.repl.apply.batchSize
is incremented with the number of operations in a batch at the batch boundaries instead of being incremented by one after each operation.For finer granularity, see
metrics.repl.apply.ops
.
-
metrics.repl.apply.
batches
¶ metrics.repl.apply.batches
reports 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.
num
¶ The total number of batches applied across all databases.
-
metrics.repl.apply.batches.
totalMillis
¶ The total amount of time in milliseconds the
mongod
has spent applying operations from the oplog.
-
metrics.repl.apply.
ops
¶ The total number of oplog operations applied.
metrics.repl.apply.ops
is incremented after each operation.See also
-
metrics.repl.
buffer
¶ MongoDB buffers oplog operations from the replication sync source buffer before applying oplog entries in a batch.
metrics.repl.buffer
provides a way to track the oplog buffer. See Multithreaded Replication for more information on the oplog application process.
-
metrics.repl.buffer.
count
¶ The current number of operations in the oplog buffer.
-
metrics.repl.buffer.
maxSizeBytes
¶ The maximum size of the buffer. This value is a constant setting in the
mongod
, and is not configurable.
-
metrics.repl.buffer.
sizeBytes
¶ The current size of the contents of the oplog buffer.
-
metrics.repl.
network
¶ metrics.repl.network
reports network use by the replication process.
-
metrics.repl.network.
bytes
¶ metrics.repl.network.bytes
reports the total amount 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 results from the oplog cursor as part of the oplog replication process.
-
metrics.repl.network.getmores.
num
¶ metrics.repl.network.getmores.num
reports the total number ofgetmore
operations, which are operations that request an additional set of operations from the replication sync source.
-
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 more data even if the
getmore
operation does not initial return data.
-
metrics.repl.network.
notPrimaryLegacyUnacknowledgedWrites
¶ The number of unacknowledged (
w: 0
) legacy write operations (see Request Opcodes) that failed because the currentmongod
is not inPRIMARY
state.Previously named
metrics.repl.network.notMasterLegacyUnacknowledgedWrites
New in version 4.2.
-
metrics.repl.network.
notPrimaryUnacknowledgedWrites
¶ The number of unacknowledged (
w: 0
) write operations that failed because the currentmongod
is not inPRIMARY
state.Previously named
metrics.repl.network.notMasterUnacknowledgedWrites
New in version 4.2.
-
metrics.repl.network.
ops
¶ The total number of operations read from the replication source.
-
metrics.repl.network.
readersCreated
¶ The total number of oplog query processes created. MongoDB will create a new oplog query any time an error occurs in the connection, including a timeout, or a network operation. Furthermore,
metrics.repl.network.readersCreated
will increment every time MongoDB selects a new source for replication.
-
metrics.repl.
stateTransition
¶ Information on user operations when the member undergoes one of the following transitions that can kill user operations:
- The member steps up to become a primary.
- The member steps down to become a secondary.
- The member is actively performing a rollback.
Changed in version 4.2.3: Previously named
metrics.repl.stepDown
when introduced in version 4.2 and tracked only the step down state change.
-
metrics.repl.stateTransition.
lastStateTransition
¶ The transition being reported:
State Change Description "stepUp"
The member steps up to become a primary. "stepDown"
The member steps down to become a secondary. "rollback"
The member is actively performing a rollback. ""
If the member has not undergone any of the aforementioned state change. New in version 4.2.3.
-
metrics.repl.stateTransition.
userOperationsKilled
¶ The number of user operations killed during the
mongod
instance’s state change.Changed in version 4.2.3: Previously named
metrics.repl.stepDown.userOperationsKilled
when introduced in version 4.2 and tracked only user operations killed during step down.
-
metrics.repl.stateTransition.
userOperationsRunning
¶ The number of user operations that remained running during the
mongod
instance’s state change.Changed in version 4.2.3: Previously named
metrics.repl.stepDown.userOperationsRunning
when introduced in version 4.2 and tracked only user operations killed during step down.
-
metrics.repl.
stepDown
¶ Removed in version 4.2.3. See
metrics.repl.stateTransition
instead.
-
metrics.repl.stepDown.
userOperationsKilled
¶ Removed in version 4.2.3. See
metrics.repl.stateTransition.userOperationsKilled
instead.
-
metrics.repl.stepDown.
userOperationsRunning
¶ Removed in version 4.2.3. See
metrics.repl.stateTransition.userOperationsRunning
instead.
-
metrics.storage.freelist.search.
bucketExhausted
¶ The number of times that
mongod
has checked the free list without finding a suitably large record allocation.
-
metrics.storage.freelist.search.
requests
¶ The number of times
mongod
has searched for available record allocations.
-
metrics.storage.freelist.search.
scanned
¶ The number of available record allocations
mongod
has searched.
-
metrics.ttl.
deletedDocuments
¶ The total number of documents deleted from collections with a ttl index.
-
metrics.ttl.
passes
¶ The number of times the background process removes documents from collections with a ttl index.
-
metrics.
cursor
¶ A document that contains data regarding cursor state and use.
-
metrics.cursor.
timedOut
¶ The total number of cursors that have timed out since the server process started. If this number is large or growing at a regular rate, this may indicate an application error.
-
metrics.cursor.
open
¶ A document that contains data regarding open cursors.
-
metrics.cursor.open.
noTimeout
¶ The number of open cursors with the option
DBQuery.Option.noTimeout
set to prevent timeout after a period of inactivity.
-
metrics.cursor.open.
pinned
¶ The number of “pinned” open cursors.
-
metrics.cursor.open.
total
¶ The number of cursors that MongoDB is maintaining for clients. Because MongoDB exhausts unused cursors, typically this value small or zero. However, if there is a queue, stale tailable cursors, or a large number of operations this value may rise.
-
metrics.cursor.open.
singleTarget
¶ The total number of cursors that only target a single shard. Only
mongos
instances reportmetrics.cursor.open.singleTarget
values.
-
metrics.cursor.open.
multiTarget
¶ 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.
Note
The watchdog
section is only present if the Storage Node Watchdog is enabled.
-
watchdog
¶ A document reporting the status of the Storage 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 the period in between status checks.
Output Changelog¶
- Starting in MongoDB 4.2.12,
serverStatus
:- Changed
notMasterLegacyUnacknowledgedWrites
tonotPrimaryLegacyUnacknowledgedWrites
- Changed
notMasterUnacknowledgedWrites
tonotPrimaryUnacknowledgedWrites
- Changed
- Starting in MongoDB 4.2.11,
serverStatus
:- Added new metrics to track use of Aggregation Pipeline methods:
- Added new metrics to track use of arrayFilter methods:
- Starting in MongoDB 4.2.6 (and 4.0.19),
serverStatus
:- Added new metrics to track aggregation stage use:
- Starting in MongoDB 4.2.2,
serverStatus
:- Added new transaction metrics in
transactions
formongos
:
- Added new transaction metrics in
- 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
parameter set 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.