OPTIONS

Server Status OutputΒΆ

This document provides a quick overview and example of the serverStatus command. The helper db.serverStatus() in the mongo shell provides access to this output. For full documentation of the content of this output, see serverStatus.

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.

Changed in version 3.0: The server status output no longer includes the workingSet, indexCounters, and recordStats sections.

The Instance Information section displays information regarding the specific mongod and mongos and its state.

"host" : "<hostname>",
"version" : "<version>",
"process" : "<mongod|mongos>",
"pid" : <num>,
"uptime" : <num>,
"uptimeMillis" : <num>,
"uptimeEstimate" : <num>,
"localTime" : ISODate(""),

The asserts document reports the number of assertions or errors produced by the server:

"asserts" : {
   "regular" : <num>,
   "warning" : <num>,
   "msg" : <num>,
   "user" : <num>,
   "rollovers" : <num>
},

The backgroundFlushing document reports on the process MongoDB uses to write data to disk. The backgroundFlushing information only returns for instances that use the MMAPv1 storage engine:

"backgroundFlushing" : {
   "flushes" : <num>,
   "total_ms" : <num>,
   "average_ms" : <num>,
   "last_ms" : <num>,
   "last_finished" : ISODate("")
},

The connections field reports on MongoDB’s current number of open incoming connections:

New in version 2.4: The totalCreated field.

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

The cursors document reports on current cursor use and state:

"cursors" : {
   "note" : "deprecated, use server status metrics",
   "clientCursors_size" : <num>,
   "totalOpen" : <num>,
   "pinned" : <num>,
   "totalNoTimeout" : <num>,
   "timedOut" : <num>
},

The Journaling (dur) document reports on data that reflect this mongod instance’s journaling-related operations and performance during a journal group commit interval. The Journaling (dur) information only returns for instances that use the MMAPv1 storage engine and have journaling enabled:

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

The fields in the extra_info document provide platform specific information. The following example block is from a Linux-based system:

"extra_info" : {
   "note" : "fields vary by platform",
   "heap_usage_bytes" : <num>,
   "page_faults" : <num>
},

The globalLock field reports on MongoDB’s global system lock. In most cases the locks document provides more fine grained data that reflects lock use:

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

The locks section reports statistics for each lock type and mode:

"locks" : {
   "Global" : {
         "acquireCount" : {
            "r" : NumberLong(<num>),
            "w" : NumberLong(<num>),
            "R" : NumberLong(<num>),
            "W" : NumberLong(<num>)
         },
         "acquireWaitCount" : {
            "r" : NumberLong(<num>),
            "w" : NumberLong(<num>),
            "R" : NumberLong(<num>),
            "W" : NumberLong(<num>)
         },
         "timeAcquiringMicros" : {
            "r" : NumberLong(<num>),
            "w" : NumberLong(<num>),
            "R" : NumberLong(<num>),
            "W" : NumberLong(<num>)
         },
         "deadlockCount" : {
            "r" : NumberLong(<num>),
            "w" : NumberLong(<num>),
            "R" : NumberLong(<num>),
            "W" : NumberLong(<num>)
         }
   },
   "MMAPV1Journal" : {
         "acquireCount" : {
            "r" : NumberLong(<num>),
            "w" : NumberLong(<num>),
            "R" : NumberLong(<num>),
            "W" : NumberLong(<num>)
         },
         "acquireWaitCount" : {
            "r" : NumberLong(<num>),
            "w" : NumberLong(<num>),
            "R" : NumberLong(<num>),
            "W" : NumberLong(<num>)
         },
         "timeAcquiringMicros" : {
            "r" : NumberLong(<num>),
            "w" : NumberLong(<num>),
            "R" : NumberLong(<num>),
            "W" : NumberLong(<num>)
         },
         "deadlockCount" : {
            "r" : NumberLong(<num>),
            "w" : NumberLong(<num>),
            "R" : NumberLong(<num>),
            "W" : NumberLong(<num>)
         }
   },
   "Database" : {
         "acquireCount" : {
            "r" : NumberLong(<num>),
            "w" : NumberLong(<num>),
            "R" : NumberLong(<num>),
            "W" : NumberLong(<num>)
         },
         "acquireWaitCount" : {
            "r" : NumberLong(<num>),
            "w" : NumberLong(<num>),
            "R" : NumberLong(<num>),
            "W" : NumberLong(<num>)
         },
         "timeAcquiringMicros" : {
            "r" : NumberLong(<num>),
            "w" : NumberLong(<num>),
            "R" : NumberLong(<num>),
            "W" : NumberLong(<num>)
         },
         "deadlockCount" : {
            "r" : NumberLong(<num>),
            "w" : NumberLong(<num>),
            "R" : NumberLong(<num>),
            "W" : NumberLong(<num>)
         }
   },
   "Collection" : {
         "acquireCount" : {
            "r" : NumberLong(<num>),
            "w" : NumberLong(<num>),
            "R" : NumberLong(<num>),
            "W" : NumberLong(<num>)
         },
         "acquireWaitCount" : {
            "r" : NumberLong(<num>),
            "w" : NumberLong(<num>),
            "R" : NumberLong(<num>),
            "W" : NumberLong(<num>)
         },
         "timeAcquiringMicros" : {
            "r" : NumberLong(<num>),
            "w" : NumberLong(<num>),
            "R" : NumberLong(<num>),
            "W" : NumberLong(<num>)
         },
         "deadlockCount" : {
            "r" : NumberLong(<num>),
            "w" : NumberLong(<num>),
            "R" : NumberLong(<num>),
            "W" : NumberLong(<num>)
         }
   },
   "Metadata" : {
         "acquireCount" : {
            "r" : NumberLong(<num>),
            "w" : NumberLong(<num>),
            "R" : NumberLong(<num>),
            "W" : NumberLong(<num>)
         },
         "acquireWaitCount" : {
            "r" : NumberLong(<num>),
            "w" : NumberLong(<num>),
            "R" : NumberLong(<num>),
            "W" : NumberLong(<num>)
         },
         "timeAcquiringMicros" : {
            "r" : NumberLong(<num>),
            "w" : NumberLong(<num>),
            "R" : NumberLong(<num>),
            "W" : NumberLong(<num>)
         },
         "deadlockCount" : {
            "r" : NumberLong(<num>),
            "w" : NumberLong(<num>),
            "R" : NumberLong(<num>),
            "W" : NumberLong(<num>)
         }
   },
   "oplog" : {
         "acquireCount" : {
            "r" : NumberLong(<num>),
            "w" : NumberLong(<num>),
            "R" : NumberLong(<num>),
            "W" : NumberLong(<num>)
         },
         "acquireWaitCount" : {
            "r" : NumberLong(<num>),
            "w" : NumberLong(<num>),
            "R" : NumberLong(<num>),
            "W" : NumberLong(<num>)
         },
         "timeAcquiringMicros" : {
            "r" : NumberLong(<num>),
            "w" : NumberLong(<num>),
            "R" : NumberLong(<num>),
            "W" : NumberLong(<num>)
         },
         "deadlockCount" : {
            "r" : NumberLong(<num>),
            "w" : NumberLong(<num>),
            "R" : NumberLong(<num>),
            "W" : NumberLong(<num>)
         }
   }
},

The network document reports on network use and state:

"network" : {
   "bytesIn" : <num>,
   "bytesOut" : <num>,
   "numRequests" : <num>
},

The opcounters document reports the number of operations this MongoDB instance has processed:

"opcounters" : {
   "insert" : <num>,
   "query" : <num>,
   "update" : <num>,
   "delete" : <num>,
   "getmore" : <num>,
   "command" : <num>
},

The opcountersRepl document reports the number of replicated operations:

"opcountersRepl" : {
   "insert" : <num>,
   "query" : <num>,
   "update" : <num>,
   "delete" : <num>,
   "getmore" : <num>,
   "command" : <num>
},

The storageEngine document reports details about the current storage engine:

"storageEngine" : {
   "name" : <string>
},

The writeBacksQueued document reports the number of writebacks:

"writeBacksQueued" : <num>,

The mem field reports on MongoDB’s current memory use:

"mem" : {
   "bits" : <num>,
   "resident" : <num>,
   "virtual" : <num>,
   "supported" : <boolean>,
   "mapped" : <num>,
   "mappedWithJournal" : <num>,
   "note" : "not all mem info support on this platform"
},

The repl document reports on the state of replication and the replica set. This document only appears for replica sets.

"repl" : {
   "setName" : <string>,
   "setVersion" : <num>,
   "ismaster" : <boolean>,
   "secondary" : <boolean>,
   "hosts" : [
         <hostname>,
         <hostname>,
         <hostname>
   ],
   "primary" : <hostname>,
   "me" : <hostname>,
   "electionId" : ObjectId(""),
   "rbid" : <num>,
   "slaves" : [
         {
             "rid" : <ObjectId>,
             "optime" : <timestamp>,
             "host" : <hostname>,
             "memberID" : <num>
         }
   ],
},

The rangeDeleter document reports the number of operations this MongoDB instance has processed. The rangeDeleter document is only present in the output of serverStatus when explicitly enabled.

"rangeDeleter" : {
   "lastDeleteStats" : [
      {
        "deletedDocs" : NumberLong(<num>),
        "queueStart" : <date>,
        "queueEnd" : <date>,
        "deleteStart" : <date>,
        "deleteEnd" : <date>,
        "waitForReplStart" : <date>,
        "waitForReplEnd" : <date>
      }
   ]
}

The security document reports details about the security features and use:

"security" : {
   "SSLServerSubjectName": <string>,
   "SSLServerHasCertificateAuthority": <boolean>,
   "SSLServerCertificateExpirationDate": <date>
},

The metrics document contains a number of operational metrics that are useful for monitoring the state and workload of a mongod instance.

New in version 2.4.

Changed in version 2.6: Added the cursor document.

"metrics" : {
   "command": {
         "<command>": {
            "failed": <num>,
            "total": <num>
         }
   },
   "cursor" : {
         "timedOut" : NumberLong(<num>),
         "open" : {
            "noTimeout" : NumberLong(<num>),
            "pinned" : NumberLong(<num>),
            "multiTarget" : NumberLong(<num>),
            "singleTarget" : NumberLong(<num>),
            "total" : NumberLong(<num>),
         }
   },
   "document" : {
         "deleted" : NumberLong(<num>),
         "inserted" : NumberLong(<num>),
         "returned" : NumberLong(<num>),
         "updated" : NumberLong(<num>)
   },
   "getLastError" : {
         "wtime" : {
            "num" : <num>,
            "totalMillis" : <num>
         },
         "wtimeouts" : NumberLong(<num>)
   },
   "operation" : {
         "fastmod" : NumberLong(<num>),
         "idhack" : NumberLong(<num>),
         "scanAndOrder" : NumberLong(<num>)
   },
   "queryExecutor": {
         "scanned" : NumberLong(<num>)
   },
   "record" : {
         "moves" : NumberLong(<num>)
   },
   "repl" : {
         "apply" : {
            "batches" : {
               "num" : <num>,
               "totalMillis" : <num>
            },
            "ops" : NumberLong(<num>)
         },
         "buffer" : {
            "count" : NumberLong(<num>),
            "maxSizeBytes" : <num>,
            "sizeBytes" : NumberLong(<num>)
         },
         "network" : {
            "bytes" : NumberLong(<num>),
            "getmores" : {
               "num" : <num>,
               "totalMillis" : <num>
            },
            "ops" : NumberLong(<num>),
            "readersCreated" : NumberLong(<num>)
         },
         "oplog" : {
            "insert" : {
               "num" : <num>,
               "totalMillis" : <num>
            },
            "insertBytes" : NumberLong(<num>)
         },
         "preload" : {
            "docs" : {
               "num" : <num>,
               "totalMillis" : <num>
            },
            "indexes" : {
               "num" : <num>,
               "totalMillis" : <num>
            }
         }
   },
   "storage" : {
         "freelist" : {
            "search" : {
               "bucketExhausted" : <num>,
               "requests" : <num>,
               "scanned" : <num>
            }
         }
   },
   "ttl" : {
         "deletedDocuments" : NumberLong(<num>),
         "passes" : NumberLong(<num>)
   }
},

The wiredTiger statistics section reports details about the WiredTiger statistics:

New in version 3.0: wiredTiger statistics section. This section appears only for the WiredTiger storage engine.

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

The final ok field holds the return status for the serverStatus command:

"ok" : 1

Was this page helpful?

Yes No

Thank you for your feedback!

We're sorry! You can Report a Problem to help us improve this page.

ON THIS PAGE