- 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 process’s state. Most monitoring applications run this command at a regular interval to collect statistics about the instance:The value (i.e.
1
above), does not affect the operation of the command.Changed in version 2.4: In 2.4 you can dynamically suppress portions of the
serverStatus
output, or include suppressed sections by adding fields to the command document as in the following examples:serverStatus
includes all fields by default, exceptworkingSet
.Note
You may only dynamically include top-level fields from the serverStatus document that are not included by default. You can exclude any field that
serverStatus
includes by default.See also
Output¶
The serverStatus
command returns a collection of information that
reflects the database’s status. These data are useful for diagnosing
and assessing the performance of your MongoDB instance. This reference
catalogs each datum included in the output of this command and
provides context for using this data to more effectively administer
your database.
See also
Much of the output of serverStatus
is also
displayed dynamically by mongostat
. See the
mongostat command for more information.
For examples of the serverStatus
output, see
Server Status Output.
Instance Information¶
For an example of the instance information, see the Instance Information section of the Server Status Output page.
-
serverStatus.
host
¶ The
host
field contains the system’s hostname. In Unix/Linux systems, this should be the same as the output of thehostname
command.
-
serverStatus.
version
¶ The
version
field contains the version of MongoDB running on the currentmongod
ormongos
instance.
-
serverStatus.
process
¶ The
process
field identifies which kind of MongoDB instance is running. Possible values are:
-
serverStatus.
uptime
¶ The value of the
uptime
field corresponds to the number of seconds that themongos
ormongod
process has been active.
-
serverStatus.
uptimeEstimate
¶ uptimeEstimate
provides the uptime as calculated from MongoDB’s internal course-grained time keeping system.
locks¶
New in version 2.1.2: All locks
statuses first appeared in the 2.1.2
development release for the 2.2 series.
For an example of the locks
output, see the locks section of the Server Status Output
page.
-
serverStatus.
locks
¶ The
locks
document contains sub-documents that provides a granular report on MongoDB database-level lock use. All values are of theNumberLong()
type.Generally, fields named:
R
refer to the global read lock,W
refer to the global write lock,r
refer to the database specific read lock, andw
refer to the database specific write lock.
If a document does not have any fields, it means that no locks have existed with this context since the last time the
mongod
started.
-
serverStatus.locks..
¶
A field named
.
holds the first document inlocks
that contains information about the global lock.
-
serverStatus.locks...
timeLockedMicros
¶ The
timeLockedMicros
document reports the amount of time in microseconds that a lock has existed in all databases in thismongod
instance.
-
serverStatus.locks...timeLockedMicros.
R
¶ The
R
field reports the amount of time in microseconds that any database has held the global read lock.
-
serverStatus.locks...timeLockedMicros.
W
¶ The
W
field reports the amount of time in microseconds that any database has held the global write lock.
-
serverStatus.locks...timeLockedMicros.
r
¶ The
r
field reports the amount of time in microseconds that any database has held the local read lock.
-
serverStatus.locks...timeLockedMicros.
w
¶ The
w
field reports the amount of time in microseconds that any database has held the local write lock.
-
serverStatus.locks...
timeAcquiringMicros
¶ The
timeAcquiringMicros
document reports the amount of time in microseconds that operations have spent waiting to acquire a lock in all databases in thismongod
instance.
-
serverStatus.locks...timeAcquiringMicros.
R
¶ The
R
field reports the amount of time in microseconds that any database has spent waiting for the global read lock.
-
serverStatus.locks...timeAcquiringMicros.
W
¶ The
W
field reports the amount of time in microseconds that any database has spent waiting for the global write lock.
-
serverStatus.locks.
admin
¶ The
admin
document contains two sub-documents that report data regarding lock use in the admin database.
-
serverStatus.locks.admin.
timeLockedMicros
¶ The
timeLockedMicros
document reports the amount of time in microseconds that locks have existed in the context of the admin database.
-
serverStatus.locks.admin.timeLockedMicros.
r
¶ The
r
field reports the amount of time in microseconds that the admin database has held the read lock.
-
serverStatus.locks.admin.timeLockedMicros.
w
¶ The
w
field reports the amount of time in microseconds that the admin database has held the write lock.
-
serverStatus.locks.admin.
timeAcquiringMicros
¶ The
timeAcquiringMicros
document reports on the amount of field time in microseconds that operations have spent waiting to acquire a lock for the admin database.
-
serverStatus.locks.admin.timeAcquiringMicros.
r
¶ The
r
field reports the amount of time in microseconds that operations have spent waiting to acquire a read lock on the admin database.
-
serverStatus.locks.admin.timeAcquiringMicros.
w
¶ The
w
field reports the amount of time in microseconds that operations have spent waiting to acquire a write lock on the admin database.
-
serverStatus.locks.
local
¶ The
local
document contains two sub-documents that report data regarding lock use in thelocal
database. The local database contains a number of instance specific data, including the oplog for replication.
-
serverStatus.locks.local.
timeLockedMicros
¶ The
timeLockedMicros
document reports on the amount of time in microseconds that locks have existed in the context of thelocal
database.
-
serverStatus.locks.local.timeLockedMicros.
r
¶ The
r
field reports the amount of time in microseconds that thelocal
database has held the read lock.
-
serverStatus.locks.local.timeLockedMicros.
w
¶ The
w
field reports the amount of time in microseconds that thelocal
database has held the write lock.
-
serverStatus.locks.local.
timeAcquiringMicros
¶ The
timeAcquiringMicros
document reports on the amount of time in microseconds that operations have spent waiting to acquire a lock for thelocal
database.
-
serverStatus.locks.local.timeAcquiringMicros.
r
¶ The
r
field reports the amount of time in microseconds that operations have spent waiting to acquire a read lock on thelocal
database.
-
serverStatus.locks.local.timeAcquiringMicros.
w
¶ The
w
field reports the amount of time in microseconds that operations have spent waiting to acquire a write lock on thelocal
database.
-
serverStatus.locks.
<database>
¶ For each additional database
locks
includes a document that reports on the lock use for this database. The names of these documents reflect the database name itself.
-
serverStatus.locks.<database>.
timeLockedMicros
¶ The
timeLockedMicros
document reports on the amount of time in microseconds that locks have existed in the context of the<database>
database.
-
serverStatus.locks.<database>.timeLockedMicros.
r
¶ The
r
field reports the amount of time in microseconds that the<database>
database has held the read lock.
-
serverStatus.locks.<database>.timeLockedMicros.
w
¶ The
w
field reports the amount of time in microseconds that the<database>
database has held the write lock.
-
serverStatus.locks.<database>.
timeAcquiringMicros
¶ The
timeAcquiringMicros
document reports on the amount of time in microseconds that operations have spent waiting to acquire a lock for the<database>
database.
-
serverStatus.locks.<database>.timeAcquiringMicros.
r
¶ The
r
field reports the amount of time in microseconds that operations have spent waiting to acquire a read lock on the<database>
database.
-
serverStatus.locks.<database>.timeAcquiringMicros.
w
¶ The
w
field reports the amount of time in microseconds that operations have spent waiting to acquire a write lock on the<database>
database.
globalLock¶
For an example of the globalLock
output, see the globalLock
section of the
Server Status Output page.
-
serverStatus.
globalLock
¶ The
globalLock
data structure contains information regarding the database’s current lock state, historical lock status, current operation queue, and the number of active clients.
-
serverStatus.globalLock.
totalTime
¶ The value of
totalTime
represents the time, in microseconds, since the database last started and created theglobalLock
. This is roughly equivalent to total server uptime.
-
serverStatus.globalLock.
lockTime
¶ The value of
lockTime
represents the time, in microseconds, since the database last started, that theglobalLock
has been held.Consider this value in combination with the value of
totalTime
.If the
lockTime
is higher and thetotalTime
is smaller (relatively), then fewer operations are responsible for a greater portion of server’s use (relatively).
-
serverStatus.globalLock.
ratio
¶
-
serverStatus.globalLock.
currentQueue
¶ The
currentQueue
data structure value provides more granular information concerning the number of operations queued because of a lock.
-
serverStatus.globalLock.currentQueue.
total
¶ The value of
total
provides a combined total of operations queued waiting for the lock.A consistently small queue, particularly of shorter operations should cause no concern. Also, consider this value in light of the size of queue waiting for the read lock (e.g.
readers
) and write lock (e.g.writers
) individually.
-
serverStatus.globalLock.currentQueue.
readers
¶ The value of
readers
is 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.
-
serverStatus.globalLock.currentQueue.
writers
¶ The value of
writers
is 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¶
-
serverStatus.globalLock.
activeClients
¶ The
activeClients
data structure provides more granular information about the number of connected clients and the operation types (e.g. read or write) performed by these clients.Use this data to provide context for the
currentQueue
data.
-
serverStatus.globalLock.activeClients.
total
¶ The value of
total
is the total number of active client connections to the database. This combines clients that are performing read operations (e.g.readers
) and clients that are performing write operations (e.g.writers
).
mem¶
For an example of the mem
output, see the mem section of the Server Status Output
page.
-
serverStatus.
mem
¶ The
mem
data structure holds information regarding the target system architecture ofmongod
and current memory use.
-
serverStatus.mem.
bits
¶ The value of
bits
is either64
or32
, depending on which target architecture specified during themongod
compilation process. In most instances this is64
, and this value does not change over time.
-
serverStatus.mem.
resident
¶ The value of
resident
is roughly equivalent to the amount of RAM, in megabytes (MB), currently used by the database process. In normal use this value tends to grow. In dedicated database servers this number tends to approach the total amount of system memory.
-
serverStatus.mem.
virtual
¶ virtual
displays the quantity, in megabytes (MB), of virtual memory used by themongod
process. With journaling enabled, the value ofvirtual
is at least twice the value ofmapped
.If
virtual
value is significantly larger thanmapped
(e.g. 3 or more times), this may indicate a memory leak.
-
serverStatus.mem.
supported
¶ supported
is true when the underlying system supports extended memory information. If this value is false and the system does not support extended memory information, then othermem
values may not be accessible to the database server.
-
serverStatus.mem.
mapped
¶ The value of
mapped
provides the amount of mapped memory, in megabytes (MB), by the database. Because MongoDB uses memory-mapped files, this value is likely to be to be roughly equivalent to the total size of your database or databases.
-
serverStatus.mem.
mappedWithJournal
¶ mappedWithJournal
provides the amount of mapped memory, in megabytes (MB), including the memory used for journaling. This value will always be twice the value ofmapped
. This field is only included if journaling is enabled.
connections¶
For an example of the connections
output, see the connections
section of the
Server Status Output page.
-
serverStatus.
connections
¶ The
connections
sub document data regarding the current status of incoming connections and availability of the database server. Use these values to assess the current load and capacity requirements of the server.
-
serverStatus.connections.
current
¶ The value of
current
corresponds to the number of connections to the database server from clients. This number includes the current shell session. Consider the value ofavailable
to add more context to this datum.This figure will include all incoming connections including any shell connections or connections from other servers, such as replica set members or
mongos
instances.
-
serverStatus.connections.
available
¶ available
provides a count of the number of unused available incoming connections the database can provide. Consider this value in combination with the value ofcurrent
to understand the connection load on the database, and the UNIX ulimit Settings document for more information about system thresholds on available connections.
-
serverStatus.connections.
totalCreated
¶ totalCreated
provides a count of all incoming connections created to the server. This number includes connections that have since closed.
extra_info¶
For an example of the extra_info
output, see the extra_info
section of the
Server Status Output page.
-
serverStatus.
extra_info
¶ The
extra_info
data structure holds data collected by themongod
instance about the underlying system. Your system may only report a subset of these fields.
-
serverStatus.extra_info.
note
¶ The field
note
reports that the data in this structure depend on the underlying platform, and has the text: “fields vary by platform.”
-
serverStatus.extra_info.
heap_usage_bytes
¶ The
heap_usage_bytes
field is only available on Unix/Linux systems, and reports the total size in bytes of heap space used by the database process.
-
serverStatus.extra_info.
page_faults
¶ The
page_faults
Reports the total number of page faults that require disk operations. Page faults refer to operations that require the database server to access data which isn’t available in active memory. Thepage_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.
indexCounters¶
For an example of the indexCounters
output, see the
indexCounters section of
the Server Status Output page.
-
serverStatus.
indexCounters
¶ Changed in version 2.2: Previously, data in the
indexCounters
document reported sampled data, and were only useful in relative comparison to each other, because they could not reflect absolute index use. In 2.2 and later, these data reflect actual index use.Changed in version 2.4: Fields previously in the
btree
embedded document ofindexCounters
are now fields in theindexCounters
document.The
indexCounters
data structure reports information regarding the state and use of indexes in MongoDB.
-
serverStatus.indexCounters.
accesses
¶ accesses
reports the number of times that operations have accessed indexes. This value is the combination of thehits
andmisses
. Higher values indicate that your database has indexes and that queries are taking advantage of these indexes. If this number does not grow over time, this might indicate that your indexes do not effectively support your use.
-
serverStatus.indexCounters.
hits
¶ The
hits
value reflects the number of times that an index has been accessed andmongod
is able to return the index from memory.A higher value indicates effective index use.
hits
values that represent a greater proportion of theaccesses
value, tend to indicate more effective index configuration.
-
serverStatus.indexCounters.
misses
¶ The
misses
value represents the number of times that an operation attempted to access an index that was not in memory. These “misses,” do not indicate a failed query or operation, but rather an inefficient use of the index. Lower values in this field indicate better index use and likely overall performance as well.
-
serverStatus.indexCounters.
resets
¶ The
resets
value reflects the number of times that the index counters have been reset since the database last restarted. Typically this value is0
, but use this value to provide context for the data specified by otherindexCounters
values.
backgroundFlushing¶
For an example of the backgroundFlushing
output, see the
backgroundFlushing section of the
Server Status Output page.
-
serverStatus.
backgroundFlushing
¶ mongod
periodically flushes writes to disk. In the default configuration, this happens every 60 seconds. ThebackgroundFlushing
data structure contains data regarding these operations. Consider these values if you have concerns about write performance and journaling.
-
serverStatus.backgroundFlushing.
flushes
¶ flushes
is a counter that collects the number of times the database has flushed all writes to disk. This value will grow as database runs for longer periods of time.
-
serverStatus.backgroundFlushing.
total_ms
¶ The
total_ms
value provides the total number of milliseconds (ms) that themongod
processes have spent writing (i.e. flushing) data to disk. Because this is an absolute value, consider the value offlushes
andaverage_ms
to provide better context for this datum.
-
serverStatus.backgroundFlushing.
average_ms
¶ The
average_ms
value describes the relationship between the number of flushes and the total amount of time that the database has spent writing data to disk. The largerflushes
is, the more likely this value is likely to represent a “normal,” time; however, abnormal data can skew this value.Use the
last_ms
to ensure that a high average is not skewed by transient historical issue or a random write distribution.
-
serverStatus.backgroundFlushing.
last_ms
¶ The value of the
last_ms
field is the amount of time, in milliseconds, that the last flush operation took to complete. Use this value to verify that the current performance of the server and is in line with the historical data provided byaverage_ms
andtotal_ms
.
-
serverStatus.backgroundFlushing.
last_finished
¶ The
last_finished
field provides a timestamp of the last completed flush operation in the ISODate format. If this value is more than a few minutes old relative to your server’s current time and accounting for differences in time zone, restarting the database may result in some data loss.Also consider ongoing operations that might skew this value by routinely block write operations.
cursors¶
Deprecated since version 2.6: See the serverStatus.metrics.cursor field instead.
For an example of the cursors
output, see the cursors section of the Server Status Output
page.
-
serverStatus.cursors.
note
¶ A note specifying to use the
serverStatus.metrics.cursor
field instead ofserverStatus.cursors
.
-
serverStatus.cursors.
totalOpen
¶ totalOpen
provides 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 cursor, or a large number of operations, this value may rise.
-
serverStatus.cursors.
clientCursors_size
¶ Deprecated since version 1.x: See
totalOpen
for this datum.
-
serverStatus.cursors.
timedOut
¶ timedOut
provides a counter of 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.
-
serverStatus.cursors.
totalNoTimeout
¶ totalNoTimeout
provides the number of open cursors with the optionDBQuery.Option.noTimeout
set to prevent timeout after a period of inactivity.
-
serverStatus.cursors.
pinned
¶ serverStatus.cursors.pinned
provides the number of “pinned” open cursors.
network¶
For an example of the network
output, see the network section of the Server Status Output
page.
-
serverStatus.network.
bytesIn
¶ The value of the
bytesIn
field reflects the amount of network traffic, in bytes, received by this database. Use this value to ensure that network traffic sent to themongod
process is consistent with expectations and overall inter-application traffic.
-
serverStatus.network.
bytesOut
¶ The value of the
bytesOut
field reflects the amount of network traffic, in bytes, sent from this database. Use this value to ensure that network traffic sent by themongod
process is consistent with expectations and overall inter-application traffic.
-
serverStatus.network.
numRequests
¶ The
numRequests
field is a counter of the total number of distinct requests that the server has received. Use this value to provide context for thebytesIn
andbytesOut
values to ensure that MongoDB’s network utilization is consistent with expectations and application use.
repl¶
For an example of the repl
output, see the repl section of the Server Status Output
page.
-
serverStatus.
repl
¶ The
repl
data structure contains status information for MongoDB’s replication (i.e. “replica set”) configuration. These values only appear when the current host has replication enabled.See Replication for more information on replication.
-
serverStatus.repl.
setName
¶ The
setName
field contains a string with the name of the current replica set. This value reflects the--replSet
command line argument, orreplSetName
value in the configuration file.See Replication for more information on replication.
-
serverStatus.repl.
ismaster
¶ The value of the
ismaster
field is eithertrue
orfalse
and reflects whether the current node is the master or primary node in the replica set.See Replication for more information on replication.
-
serverStatus.repl.
secondary
¶ The value of the
secondary
field is eithertrue
orfalse
and reflects whether the current node is a secondary node in the replica set.See Replication for more information on replication.
-
serverStatus.repl.
hosts
¶ hosts
is an array that lists the other nodes in the current replica set. Each member of the replica set appears in the form ofhostname:port
.See Replication for more information on replication.
opcountersRepl¶
For an example of the opcountersRepl
output, see the
opcountersRepl section of
the Server Status Output page.
-
serverStatus.
opcountersRepl
¶ The
opcountersRepl
data structure, similar to theopcounters
data structure, provides an overview of database replication operations by type and makes it possible to analyze the load on the replica in more granular manner. These values only appear when the current host has replication enabled.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. Analyze these values over time to track database utilization.
-
serverStatus.opcountersRepl.
insert
¶ insert
provides a counter of the total number of replicated insert operations since themongod
instance last started.
-
serverStatus.opcountersRepl.
query
¶ query
provides a counter of the total number of replicated queries since themongod
instance last started.
-
serverStatus.opcountersRepl.
update
¶ update
provides a counter of the total number of replicated update operations since themongod
instance last started.
-
serverStatus.opcountersRepl.
delete
¶ delete
provides a counter of the total number of replicated delete operations since themongod
instance last started.
opcounters¶
For an example of the opcounters
output, see the opcounters
section of the
Server Status Output page.
-
serverStatus.
opcounters
¶ The
opcounters
data structure provides an overview of database operations by type and makes it possible to analyze the load on the database in more granular manner.These numbers will grow over time and in response to database use. 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. Seedocument
for more granular document-level operation tracking.Additionally, these values reflect received operations, and increment even when operations are not successful.
-
serverStatus.opcounters.
insert
¶ insert
provides a counter of the total number of insert operations received since themongod
instance last started.
-
serverStatus.opcounters.
query
¶ query
provides a counter of the total number of queries received since themongod
instance last started.
-
serverStatus.opcounters.
update
¶ update
provides a counter of the total number of update operations recieved since themongod
instance last started.
-
serverStatus.opcounters.
delete
¶ delete
provides a counter of the total number of delete operations since themongod
instance last started.
asserts¶
For an example of the asserts
output, see the asserts section of the Server Status Output
page.
-
serverStatus.
asserts
¶ The
asserts
document reports the number of asserts on the database. While assert errors are typically uncommon, if there are non-zero values for theasserts
, you should check the log file for themongod
process for more information. In many cases these errors are trivial, but are worth investigating.
-
serverStatus.asserts.
regular
¶ The
regular
counter tracks the number of regular assertions raised since the server process started. Check the log file for more information about these messages.
-
serverStatus.asserts.
warning
¶ The
warning
counter tracks the number of warnings raised since the server process started. Check the log file for more information about these warnings.
-
serverStatus.asserts.
msg
¶ The
msg
counter tracks the number of message assertions raised since the server process started. Check the log file for more information about these messages.
-
serverStatus.asserts.
user
¶ The
user
counter reports the number of “user asserts” that have occurred since the last time the server 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.
-
serverStatus.asserts.
rollovers
¶ The
rollovers
counter displays the number of times that the rollover counters have rolled over since the last time the server process started. The counters will rollover to zero after 230 assertions. Use this value to provide context to the other values in theasserts
data structure.
writeBacksQueued¶
For an example of the writeBacksQueued
output, see the
writeBacksQueued section of the
Server Status Output page.
-
serverStatus.
writeBacksQueued
¶ The value of
writeBacksQueued
istrue
when there are operations from amongos
instance queued for retrying. Typically this option is false.See also
Journaling (dur)¶
New in version 1.8.
For an example of the Journaling (dur)
output, see the
journaling section of the
Server Status Output page.
-
serverStatus.
dur
¶ The
dur
(for “durability”) document contains data regarding themongod
’s journaling-related operations and performance.mongod
must be running with journaling for these data to appear in the output of “serverStatus
”.MongoDB reports the data in
dur
based on 3 second intervals of data, collected between 3 and 6 seconds in the past.See also
Journaling Mechanics for more information about journaling operations.
-
serverStatus.dur.
commits
¶ The
commits
provides the number of transactions written to the journal during the last journal group commit interval.
-
serverStatus.dur.
journaledMB
¶ The
journaledMB
provides the amount of data in megabytes (MB) written to journal during the last journal group commit interval.
-
serverStatus.dur.
writeToDataFilesMB
¶ The
writeToDataFilesMB
provides the amount of data in megabytes (MB) written from journal to the data files during the last journal group commit interval.
-
serverStatus.dur.
compression
¶ New in version 2.0.
The
compression
represents the compression ratio of the data written to the journal:
-
serverStatus.dur.
commitsInWriteLock
¶ The
commitsInWriteLock
provides a count of the commits that occurred while a write lock was held. Commits in a write lock indicate a MongoDB node under a heavy write load and call for further diagnosis.
-
serverStatus.dur.
earlyCommits
¶ The
earlyCommits
value reflects the number of times MongoDB requested a commit before the scheduled journal group commit interval. Use this value to ensure that your journal group commit interval is not too long for your deployment.
-
serverStatus.dur.
timeMS
¶ The
timeMS
document provides information about the performance of themongod
instance during the various phases of journaling in the last journal group commit interval.
-
serverStatus.dur.timeMS.
dt
¶ The
dt
value provides, in milliseconds, the amount of time over which MongoDB collected thetimeMS
data. Use this field to provide context to the othertimeMS
field values.
-
serverStatus.dur.timeMS.
prepLogBuffer
¶ The
prepLogBuffer
value provides, in milliseconds, the amount of time spent preparing to write to the journal. Smaller values indicate better journal performance.
-
serverStatus.dur.timeMS.
writeToJournal
¶ The
writeToJournal
value provides, in milliseconds, the amount of time spent actually writing to the journal. File system speeds and device interfaces can affect performance.
-
serverStatus.dur.timeMS.
writeToDataFiles
¶ The
writeToDataFiles
value provides, in milliseconds, the amount of time spent writing to data files after journaling. File system speeds and device interfaces can affect performance.
-
serverStatus.dur.timeMS.
remapPrivateView
¶ The
remapPrivateView
value provides, in milliseconds, the amount of time spent remapping copy-on-write memory mapped views. Smaller values indicate better journal performance.
recordStats¶
For an example of the recordStats
output, see the recordStats
section of the
Server Status Output page.
-
serverStatus.
recordStats
¶ The
recordStats
document provides fine grained reporting on page faults on a per database level.MongoDB uses a read lock on each database to return
recordStats
. To minimize this overhead, you can disable this section, as in the following operation:
-
serverStatus.recordStats.
accessesNotInMemory
¶ accessesNotInMemory
reflects the number of timesmongod
needed to access a memory page that was not resident in memory for all databases managed by thismongod
instance.
-
serverStatus.recordStats.
pageFaultExceptionsThrown
¶ pageFaultExceptionsThrown
reflects the number of page fault exceptions thrown bymongod
when accessing data for all databases managed by thismongod
instance.
-
serverStatus.recordStats.local.
accessesNotInMemory
¶ accessesNotInMemory
reflects the number of timesmongod
needed to access a memory page that was not resident in memory for thelocal
database.
-
serverStatus.recordStats.local.
pageFaultExceptionsThrown
¶ pageFaultExceptionsThrown
reflects the number of page fault exceptions thrown bymongod
when accessing data for thelocal
database.
-
serverStatus.recordStats.admin.
accessesNotInMemory
¶ accessesNotInMemory
reflects the number of timesmongod
needed to access a memory page that was not resident in memory for the admin database.
-
serverStatus.recordStats.admin.
pageFaultExceptionsThrown
¶ pageFaultExceptionsThrown
reflects the number of page fault exceptions thrown bymongod
when accessing data for the admin database.
-
serverStatus.recordStats.<database>.
accessesNotInMemory
¶ accessesNotInMemory
reflects the number of timesmongod
needed to access a memory page that was not resident in memory for the<database>
database.
-
serverStatus.recordStats.<database>.
pageFaultExceptionsThrown
¶ pageFaultExceptionsThrown
reflects the number of page fault exceptions thrown bymongod
when accessing data for the<database>
database.
workingSet¶
New in version 2.4.
Note
The workingSet
data is only included in
the output of serverStatus
if explicitly enabled. To
return the workingSet
, use one of the
following commands:
For an example of the workingSet
output, see the workingSet
section of the
Server Status Output page.
-
serverStatus.
workingSet
¶ workingSet
is a document that contains values useful for estimating the size of the working set, which is the amount of data that MongoDB uses actively.workingSet
uses an internal data structure that tracks pages accessed bymongod
.
-
serverStatus.workingSet.
note
¶ note
is a field that holds a string warning that theworkingSet
document is an estimate.
-
serverStatus.workingSet.
pagesInMemory
¶ pagesInMemory
contains a count of the total number of pages accessed bymongod
over the period displayed inoverSeconds
. The default page size is 4 kilobytes: to convert this value to the amount of data in memory multiply this value by 4 kilobytes.If your total working set is less than the size of physical memory, over time the value of
pagesInMemory
will reflect your data size.Use
pagesInMemory
in conjunction withoverSeconds
to help estimate the actual size of the working set.
-
serverStatus.workingSet.
computationTimeMicros
¶ computationTimeMicros
reports the amount of time themongod
instance used to compute the other fields in theworkingSet
section.Reporting on
workingSet
may impact the performance of other operations on themongod
instance because MongoDB must collect some data within the context of a lock. Ensure that automated monitoring tools consider this metric when determining the frequency of collection forworkingSet
.
-
serverStatus.workingSet.
overSeconds
¶ overSeconds
returns the amount of time elapsed between the newest and oldest pages tracked in thepagesInMemory
data point.If
overSeconds
is decreasing, or ifpagesInMemory
equals physical RAM andoverSeconds
is very small, the working set may be much larger than physical RAM.When
overSeconds
is large, MongoDB’s data set is equal to or smaller than physical RAM.
metrics¶
For an example of the metrics output, see the metrics section of the Server Status Output page.
New in version 2.4.
-
serverStatus.
metrics
¶ The
metrics
document holds a number of statistics that reflect the current use and state of a runningmongod
instance.
-
serverStatus.metrics.
document
¶ The
document
holds a document of that reflect document access and modification patterns and data use. Compare these values to the data in theopcounters
document, which track total number of operations.
-
serverStatus.metrics.document.
returned
¶ returned
reports the total number of documents returned by queries.
-
serverStatus.metrics.
getLastError
¶ getLastError
is a document that reports ongetLastError
use.
-
serverStatus.metrics.getLastError.
wtime
¶ wtime
is an embedded document that reportsgetLastError
operation counts with aw
argument greater than1
.
-
serverStatus.metrics.getLastError.wtime.
num
¶ num
reports the total number ofgetLastError
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
.)
-
serverStatus.metrics.getLastError.wtime.
totalMillis
¶ totalMillis
reports the total amount of time in milliseconds that themongod
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
.)
-
serverStatus.metrics.getLastError.
wtimeouts
¶ wtimeouts
reports the number of times that write concern operations have timed out as a result of thewtimeout
threshold togetLastError
.
-
serverStatus.metrics.
operation
¶ operation
is an embedded document that holds counters for several types of update and query operations that MongoDB handles using special operation types.
-
serverStatus.metrics.operation.
fastmod
¶ fastmod
reports the number of update operations that neither cause documents to grow nor require updates to the index. For example, this counter would record an update operation that use the$inc
operator to increment the value of a field that is not indexed.
-
serverStatus.metrics.operation.
idhack
¶ idhack
reports the number of queries that contain the_id
field. For these queries, MongoDB will use default index on the_id
field and skip all query plan analysis.
-
serverStatus.metrics.operation.
scanAndOrder
¶ scanAndOrder
reports the total number of queries that return sorted numbers that cannot perform the sort operation using an index.
-
serverStatus.metrics.
queryExecutor
¶ queryExecutor
is a document that reports data from the query execution system.
-
serverStatus.metrics.queryExecutor.
scanned
¶ scanned
reports the total number of index items scanned during queries and query-plan evaluation. This counter is the same asnscanned
in the output ofexplain()
.
-
serverStatus.metrics.
record
¶ record
is a document that reports data related to record allocation in the on-disk memory files.
-
serverStatus.metrics.record.
moves
¶ moves
reports the total number of times documents move within the on-disk representation of the MongoDB data set. Documents move as a result of operations that increase the size of the document beyond their allocated record size.
-
serverStatus.metrics.
repl
¶ repl
holds an embedded document that reports metrics related to the replication process.repl
document appears on allmongod
instances, even those that aren’t members of replica sets.
-
serverStatus.metrics.repl.
apply
¶ apply
holds an embedded document that reports on the application of operations from the replication oplog.
-
serverStatus.metrics.repl.apply.
batches
¶ batches
reports on the oplog application process on secondaries members of replica sets. See Multithreaded Replication for more information on the oplog application processes
-
serverStatus.metrics.repl.apply.batches.
num
¶ num
reports the total number of batches applied across all databases.
-
serverStatus.metrics.repl.apply.batches.
totalMillis
¶ totalMillis
reports the total amount of time themongod
has spent applying operations from the oplog.
-
serverStatus.metrics.repl.
buffer
¶ MongoDB buffers oplog operations from the replication sync source buffer before applying oplog entries in a batch.
buffer
provides a way to track the oplog buffer. See Multithreaded Replication for more information on the oplog application process.
-
serverStatus.metrics.repl.buffer.
count
¶ count
reports the current number of operations in the oplog buffer.
-
serverStatus.metrics.repl.buffer.
maxSizeBytes
¶ maxSizeBytes
reports the maximum size of the buffer. This value is a constant setting in themongod
, and is not configurable.
-
serverStatus.metrics.repl.buffer.
sizeBytes
¶ sizeBytes
reports the current size of the contents of the oplog buffer.
-
serverStatus.metrics.repl.network.
bytes
¶ bytes
reports the total amount of data read from the replication sync source.
-
serverStatus.metrics.repl.network.
getmores
¶ getmores
reports on thegetmore
operations, which are requests for additional results from the oplog cursor as part of the oplog replication process.
-
serverStatus.metrics.repl.network.getmores.
num
¶ num
reports the total number ofgetmore
operations, which are operations that request an additional set of operations from the replication sync source.
-
serverStatus.metrics.repl.network.getmores.
totalMillis
¶ 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.
-
serverStatus.metrics.repl.network.
ops
¶ ops
reports the total number of operations read from the replication source.
-
serverStatus.metrics.repl.network.
readersCreated
¶ readersCreated
reports 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,readersCreated
will increment every time MongoDB selects a new source for replication.
-
serverStatus.metrics.repl.
preload
¶ preload
reports on the “pre-fetch” stage, where MongoDB loads documents and indexes into RAM to improve replication throughput.See Multithreaded Replication for more information about the pre-fetch stage of the replication process.
-
serverStatus.metrics.repl.preload.
docs
¶ docs
is an embedded document that reports on the documents loaded into memory during the pre-fetch stage.
-
serverStatus.metrics.repl.preload.docs.
num
¶ num
reports the total number of documents loaded during the pre-fetch stage of replication.
-
serverStatus.metrics.repl.preload.docs.
totalMillis
¶ totalMillis
reports the total amount of time spent loading documents as part of the pre-fetch stage of replication.
-
serverStatus.metrics.repl.preload.
indexes
¶ indexes
is an embedded document that reports on the index items loaded into memory during the pre-fetch stage of replication.See Multithreaded Replication for more information about the pre-fetch stage of replication.
-
serverStatus.metrics.repl.preload.indexes.
num
¶ num
reports the total number of index entries loaded by members before updating documents as part of the pre-fetch stage of replication.
-
serverStatus.metrics.repl.preload.indexes.
totalMillis
¶ totalMillis
reports the total amount of time spent loading index entries as part of the pre-fetch stage of replication.
-
serverStatus.storage.freelist.search.
bucketExhausted
¶ bucketExhausted
reports the number of times thatmongod
has checked the free list without finding a suitably large record allocation.
-
serverStatus.storage.freelist.search.
requests
¶ requests
reports the number of timesmongod
has searched for available record allocations.
-
serverStatus.storage.freelist.search.
scanned
¶ scanned
reports the number of available record allocationsmongod
has searched.
-
serverStatus.metrics.
ttl
¶ ttl
is an embedded document that reports on the operation of the resource use of the ttl index process.
-
serverStatus.metrics.ttl.
deletedDocuments
¶ deletedDocuments
reports the total number of documents deleted from collections with a ttl index.
-
serverStatus.metrics.ttl.
passes
¶ passes
reports the number of times the background process removes documents from collections with a ttl index.
-
serverStatus.metrics.
cursor
¶ New in version 2.6.
The
cursor
is a document that contains data regarding cursor state and use.
-
serverStatus.metrics.cursor.
timedOut
¶ New in version 2.6.
timedOut
provides 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.
-
serverStatus.metrics.cursor.
open
¶ New in version 2.6.
The
open
is an embedded document that contains data regarding open cursors.
-
serverStatus.metrics.cursor.open.
noTimeout
¶ New in version 2.6.
noTimeout
provides the number of open cursors with the optionDBQuery.Option.noTimeout
set to prevent timeout after a period of inactivity.
-
serverStatus.metrics.cursor.open.
pinned
¶ New in version 2.6.
serverStatus.metrics.cursor.open.pinned
provides the number of “pinned” open cursors.
-
serverStatus.metrics.cursor.open.
total
¶ New in version 2.6.
total
provides 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.