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 fields included in this output vary slightly depending on the version of MongoDB, underlying operating system platform, and the kind of node, including mongos, mongod or replica set member.

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 locks section reports data that reflect the state and use of both global (i.e. .) and database specific locks:

"locks" : {
        "." : {
                "timeLockedMicros" : {
                        "R" : <num>,
                        "W" : <num>
                },
                "timeAcquiringMicros" : {
                        "R" : <num>,
                        "W" : <num>
                }
        },
        "admin" : {
                "timeLockedMicros" : {
                        "r" : <num>,
                        "w" : <num>
                },
                "timeAcquiringMicros" : {
                        "r" : <num>,
                        "w" : <num>
                }
        },
        "local" : {
                "timeLockedMicros" : {
                        "r" : <num>,
                        "w" : <num>
                },
                "timeAcquiringMicros" : {
                        "r" : <num>,
                        "w" : <num>
                }
        },
        "<database>" : {
                "timeLockedMicros" : {
                        "r" : <num>,
                        "w" : <num>
                },
                "timeAcquiringMicros" : {
                        "r" : <num>,
                        "w" : <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>,
        "lockTime" : <num>,
        "currentQueue" : {
                "total" : <num>,
                "readers" : <num>,
                "writers" : <num>
        },
        "activeClients" : {
                "total" : <num>,
                "readers" : <num>,
                "writers" : <num>
        }
},

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

"mem" : {
        "bits" : <num>,
        "resident" : <num>,
        "virtual" : <num>,
        "supported" : <boolean>,
        "mapped" : <num>,
        "mappedWithJournal" : <num>
},

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

Changed in version 2.4: The totalCreated field.

"connections" : {
        "current" : <num>,
        "available" : <num>,
        "totalCreated" : NumberLong(<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 indexCounters document reports on index use:

"indexCounters" : {
        "accesses" : <num>,
        "hits" : <num>,
        "misses" : <num>,
        "resets" : <num>,
        "missRatio" : <num>
},

The backgroundFlushing document reports on the process MongoDB uses to write data to disk:

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

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 network document reports on network use and state:

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

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

"repl" : {
        "setName" : "<string>",
        "ismaster" : <boolean>,
        "secondary" : <boolean>,
        "hosts" : [
                <hostname>,
                <hostname>,
                <hostname>
        ],
        "primary" : <hostname>,
        "me" : <hostname>

The opcountersRepl document reports the number of replicated operations:

"opcountersRepl" : {
        "insert" : <num>,
        "query" : <num>,
        "update" : <num>,
        "delete" : <num>,
        "getmore" : <num>,
        "command" : <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 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 writeBacksQueued document reports the number of writebacks:

"writeBacksQueued" : <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:

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

The recordStats document reports data on MongoDB’s ability to predict page faults and yield write operations when required data isn’t in memory:

"recordStats" : {
        "accessesNotInMemory" : <num>,
        "pageFaultExceptionsThrown" : <num>,
        "local" : {
                "accessesNotInMemory" : <num>,
                "pageFaultExceptionsThrown" : <num>
        },
        "<database>" : {
                "accessesNotInMemory" : <num>,
                "pageFaultExceptionsThrown" : <num>
        }
},

The workingSet document provides an estimated size of the MongoDB instance’s working set. This data may not exactly reflect the size of the working set in all cases. Additionally, the workingSet document is only present in the output of serverStatus when explicitly enabled.

New in version 2.4.

"workingSet" : {
        "note" : "thisIsAnEstimate",
        "pagesInMemory" : <num>,
        "computationTimeMicros" : <num>,
        "overSeconds" : num
},

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" : {
       "cursor" : {
             "timedOut" : NumberLong(<num>),
             "open" : {
                "noTimeout" : NumberLong(<num>),
                "pinned" : 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>
                        }
                }
        },
        "ttl" : {
                "deletedDocuments" : NumberLong(<num>),
                "passes" : NumberLong(<num>)
        }
},

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

"ok" : 1
ON THIS PAGE