diff --git a/source/reference.txt b/source/reference.txt index 2b5c28242b7..b9f9481ba6e 100644 --- a/source/reference.txt +++ b/source/reference.txt @@ -31,6 +31,8 @@ Statuses and Errors .. toctree:: :maxdepth: 1 + + reference/server-status-index reference/server-status reference/database-statistics reference/collection-statistics @@ -74,7 +76,7 @@ Current release: - :wiki:`v2.0 Release Notes <2.0+Release+Notes>` -Previous release: +Previous release: - :wiki:`v1.8 Release Notes <1.8+Release+Notes>` diff --git a/source/reference/server-status-index.txt b/source/reference/server-status-index.txt new file mode 100644 index 00000000000..c8fb3374df6 --- /dev/null +++ b/source/reference/server-status-index.txt @@ -0,0 +1,357 @@ +========================== +Server Status Output Index +========================== + +.. default-domain:: mongodb + +This document provides a quick overview and example of the the +:dbcommand:`serverStatus` command. The helper :func:`db.serverStatus()` +in the :program:`mongo` shell provides access to this output. For full +documentation of the content of this output, see +:doc:`/reference/server-status`. + +.. .. When adding status fields to this document, make sure that the + ``docs/source/reference/server-status.txt`` document also reflects + those changes. + +.. note:: + + The fields included in this output vary slightly depending on the + version of MongoDB, underlaying operating system platform, and the + kind of node, including :program:`mongos`, :program:`mongod` or + :term:`replica set` member. + +.. _server-status-example-instance-information: + +The ":ref:`server-status-instance-information`" section displays +information regarding the specific :program:`mongod` and +:program:`mongos` and its state. + +.. code-block:: javascript + + { + "host" : "", + "version" : "", + "process" : "", + "pid" : , + "uptime" : , + "uptimeMillis" : , + "uptimeEstimate" : , + "localTime" : ISODate(""), + +.. _server-status-example-locks: + +The ":ref:`server-status-locks`" section reports data that reflect the +state and use of both global (i.e. ``.``) and database specific locks: + +.. code-block:: javascript + + "locks" : { + "." : { + "timeLockedMicros" : { + "R" : , + "W" : + }, + "timeAcquiringMicros" : { + "R" : , + "W" : + } + }, + "admin" : { + "timeLockedMicros" : { + "r" : , + "w" : + }, + "timeAcquiringMicros" : { + "r" : , + "w" : + } + }, + "local" : { + "timeLockedMicros" : { + "r" : , + "w" : + }, + "timeAcquiringMicros" : { + "r" : , + "w" : + } + }, + "" : { + "timeLockedMicros" : { + "r" : , + "w" : + }, + "timeAcquiringMicros" : { + "r" : , + "w" : + } + } + }, + +.. _server-status-example-globallock: + +The ":ref:`server-status-globallock`" field reports on MongoDB's +global system lock. In most cases the :ref:`locks ` document +provides more fine grained data that reflects lock use: + +.. code-block:: javascript + + "globalLock" : { + "totalTime" : , + "lockTime" : , + "currentQueue" : { + "total" : , + "readers" : , + "writers" : + }, + "activeClients" : { + "total" : , + "readers" : , + "writers" : + } + }, + +.. _server-status-example-memory: + +The ":ref:`server-status-memory`" field reports on MongoDB's +current memory use: + +.. code-block:: javascript + + "mem" : { + "bits" : , + "resident" : , + "virtual" : , + "supported" : , + "mapped" : , + "mappedWithJournal" : + }, + +.. _server-status-example-connections: + +The ":ref:`server-status-connections`" field reports on MongoDB's +current memory use by the MongoDB process: + +.. code-block:: javascript + + "connections" : { + "current" : , + "available" : + }, + +.. _server-status-example-extrainfo: + +The fields in the ":ref:`server-status-extra-info`" document provide +platform specific information. The following example block is from a +Linux-based system: + +.. code-block:: javascript + + "extra_info" : { + "note" : "fields vary by platform", + "heap_usage_bytes" : , + "page_faults" : + }, + +.. _server-status-example-indexcounters: + +The ":ref:`server-status-indexcounters`" document reports on index +use: + +.. code-block:: javascript + + "indexCounters" : { + "btree" : { + "accesses" : , + "hits" : , + "misses" : , + "resets" : , + "missRatio" : + } + }, + +.. _server-status-example-backgroundflushing: + +The ":ref:`server-status-backgroundflushing`" document reports on the +process MongoDB uses to write data to disk: + +.. code-block:: javascript + + "backgroundFlushing" : { + "flushes" : , + "total_ms" : , + "average_ms" : , + "last_ms" : , + "last_finished" : ISODate("") + }, + +.. _server-status-example-cursors: + +The ":ref:`server-status-cursors`" document reports on current cursor +use and state: + +.. code-block:: javascript + + "cursors" : { + "totalOpen" : , + "clientCursors_size" : , + "timedOut" : + }, + +.. _server-status-example-network: + +The ":ref:`server-status-network`" document reports on network use and +state: + +.. code-block:: javascript + + "network" : { + "bytesIn" : , + "bytesOut" : , + "numRequests" : + }, + +.. _server-status-example-repl: + +The ":ref:`server-status-repl`" document reports on the state of +replication and the :term:`replica set`. This document only appears +for replica sets. + +.. code-block:: javascript + + "repl" : { + "setName" : "", + "ismaster" : , + "secondary" : , + "hosts" : [ + , + , + + ], + "primary" : , + "me" : + }, + +.. _server-status-example-opcountersrepl: + +The ":ref:`server-status-opcounters-repl`" document reports the number +of replicated operations: + +.. code-block:: javascript + + "opcountersRepl" : { + "insert" : , + "query" : , + "update" : , + "delete" : , + "getmore" : , + "command" : + }, + +.. _server-status-example-replnetworkqueue: + +The ":ref:`server-status-repl-network-queue`" document holds +information regarding the queue that :term:`secondaries ` +use to poll data from other members of their set: + +.. code-block:: javascript + + "replNetworkQueue" : { + "waitTimeMs" : , + "numElems" : , + "numBytes" : + }, + +.. _server-status-example-opcounters: + +The ":ref:`server-status-opcounters`" document reports the number of +operations this MongoDB instance has processed: + +.. code-block:: javascript + + "opcounters" : { + "insert" : , + "query" : , + "update" : , + "delete" : , + "getmore" : , + "command" : + }, + +.. _server-status-example-asserts: + +The ":ref:`server-status-asserts`" document reports the number of +assertions or errors produced by the server: + +.. code-block:: javascript + + "asserts" : { + "regular" : , + "warning" : , + "msg" : , + "user" : , + "rollovers" : + }, + +.. _server-status-example-writebacksqueued: + +The ":ref:`server-status-writebacksqueued`" document reports the number of +:term:`writebacks`: + +.. code-block:: javascript + + "writeBacksQueued" : , + +.. _server-status-example-journaling: + +The ":ref:`server-status-journaling`" document reports data that +reflect this :program:`mongod` journaling related operations and +performance: + +.. code-block:: javascript + + "dur" : { + "commits" : , + "journaledMB" : , + "writeToDataFilesMB" : , + "compression" : , + "commitsInWriteLock" : , + "earlyCommits" : , + "timeMs" : { + "dt" : , + "prepLogBuffer" : , + "writeToJournal" : , + "writeToDataFiles" : , + "remapPrivateView" : + } + }, + +.. _server-status-example-recordstats: + +The ":ref:`server-status-recordstats`" document reports data on +MongoDB's ability to predict page faults and yield write operations +when required data isn't in memory: + +.. code-block:: javascript + + "recordStats" : { + "accessesNotInMemory" : , + "pageFaultExceptionsThrown" : , + "local" : { + "accessesNotInMemory" : , + "pageFaultExceptionsThrown" : + }, + "" : { + "accessesNotInMemory" : , + "pageFaultExceptionsThrown" : + } + }, + +The final ``ok`` field holds the return status for the +:dbcommand:`serverStatus` command: + +.. code-block:: javascript + + "ok" : 1 + } diff --git a/source/reference/server-status.txt b/source/reference/server-status.txt index 69043f93d0e..8b3134e1e71 100644 --- a/source/reference/server-status.txt +++ b/source/reference/server-status.txt @@ -4,6 +4,10 @@ Server Status Reference .. default-domain:: mongodb +.. When adding status fields to this document, make sure that the + ``docs/source/reference/server-status-index.txt`` document also + reflects those changes. + The :dbcommand:`serverStatus` 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 @@ -13,10 +17,17 @@ your database. .. seealso:: Much of the output of :dbcommand:`serverStatus` is also displayed dynamically by :program:`mongostat`. See the - :doc:`/reference/mongostat` reference for more information. + :doc:`/reference/mongostat` for more information. + + For examples of the :dbcommand:`serverStatus` output, see + :doc:`/reference/server-status-index`. + +.. _server-status-instance-information: -Basic Information ------------------ +Instance Information +-------------------- + +.. example:: output of the :ref:`instance information ` fields. .. status:: host @@ -54,6 +65,7 @@ Basic Information server, in UTC specified in an ISODate format. .. _locks: +.. _server-status-locks: locks ----- @@ -62,6 +74,8 @@ locks All :status:`locks` statuses first appeared in the 2.1.2 development release for the 2.2 series. +.. example:: output of the :ref:`locks ` fields. + .. status:: locks The :status:`locks` document contains sub-documents that provides a @@ -85,44 +99,44 @@ locks that contains information about the global lock as well as aggregated data regarding lock use in all databases. -.. status:: locks...timeLocked +.. status:: locks...timeLockedMicros - The :status:`locks...timeLocked` document reports the amount of + The :status:`locks...timeLockedMicros` document reports the amount of time in microseconds that a lock has existed in all databases in this :program:`mongod` instance. -.. status:: locks...timeLocked.R +.. status:: locks...timeLockedMicros.R The ``R`` field reports the amount of time in microseconds that any database databases has held the global read lock. -.. status:: locks...timeLocked.W +.. status:: locks...timeLockedMicros.W The ``W`` field reports the amount of time in microseconds that any database databases has held the global write lock. -.. status:: locks...timeLocked.r +.. status:: locks...timeLockedMicros.r The ``r`` field reports the amount of time in microseconds that any database databases has held the local read lock. -.. status:: locks...timeLocked.w +.. status:: locks...timeLockedMicros.w The ``w`` field reports the amount of time in microseconds that any database databases has held the local write lock. -.. status:: locks...timeAcquiring +.. status:: locks...timeAcquiringMicros - The :status:`locks...timeAcquiring` document reports the amount of + The :status:`locks...timeAcquiringMicros` document reports the amount of time in microseconds that operations have spent waiting to acquire a lock in all database in this :program:`mongod` instance. -.. status:: locks...timeAcquiring.R +.. status:: locks...timeAcquiringMicros.R The ``R`` field reports the amount of time in microseconds that any database databases has spent waiting for the global read lock. -.. status:: locks...timeAcquiring.W +.. status:: locks...timeAcquiringMicros.W The ``W`` field reports the amount of time in microseconds that any database databases has spent waiting for the global write lock. @@ -132,35 +146,35 @@ locks The :status:`locks.admin` document contains two sub-documents that reports data regarding lock use in the ``admin`` database. -.. status:: locks.admin.timeLocked +.. status:: locks.admin.timeLockedMicros - The :status:`locks.admin.timeLocked` document reports the amount of + The :status:`locks.admin.timeLockedMicros` document reports the amount of time in microseconds that locks have existed in the context of the ``admin`` database. -.. status:: locks.admin.timeLocked.r +.. status:: locks.admin.timeLockedMicros.r The ``r`` field reports the amount of time in microseconds that the ``admin`` database has held the read lock. -.. status:: locks.admin.timeLocked.w +.. status:: locks.admin.timeLockedMicros.w The ``w`` field reports the amount of time in microseconds that the ``admin`` database has held the write lock. -.. status:: locks.admin.timeAcquiring +.. status:: locks.admin.timeAcquiringMicros - The :status:`locks.admin.timeAcquiring` document reports on the + The :status:`locks.admin.timeAcquiringMicros` document reports on the amount of field time in microseconds that operations have spent waiting to acquire a lock for the ``admin`` database. -.. status:: locks.admin.timeAcquiring.r +.. status:: locks.admin.timeAcquiringMicros.r The ``r`` field reports the amount of time in microseconds that operations have spent waiting a read lock on the ``admin`` database. -.. status:: locks.admin.timeAcquiring.w +.. status:: locks.admin.timeAcquiringMicros.w The ``w`` field reports the amount of time in microseconds that operations have spent waiting a write lock on the ``admin`` @@ -173,85 +187,90 @@ locks local database contains a number of instance specific data, including the :term:`oplog` for replication. -.. status:: locks.local.timeLocked +.. status:: locks.local.timeLockedMicros - The :status:`locks.local.timeLocked` document reports on the amount + The :status:`locks.local.timeLockedMicros` document reports on the amount of time in microseconds that locks have existed in the context of the ``local`` database. -.. status:: locks.local.timeLocked.r +.. status:: locks.local.timeLockedMicros.r The ``r`` field reports the amount of time in microseconds that the ``local`` database has held the read lock. -.. status:: locks.local.timeLocked.w +.. status:: locks.local.timeLockedMicros.w The ``w`` field reports the amount of time in microseconds that the ``local`` database has held the write lock. -.. status:: locks.local.timeAcquiring +.. status:: locks.local.timeAcquiringMicros - The :status:`locks.local.timeAcquiring` document reports on the + The :status:`locks.local.timeAcquiringMicros` document reports on the amount of time in microseconds that operations have spent waiting to acquire a lock for the ``local`` database. -.. status:: locks.local.timeAcquiring.r +.. status:: locks.local.timeAcquiringMicros.r The ``r`` field reports the amount of time in microseconds that operations have spent waiting a read lock on the ``local`` database. -.. status:: locks.local.timeAcquiring.w +.. status:: locks.local.timeAcquiringMicros.w The ``w`` field reports the amount of time in microseconds that operations have spent waiting a write lock on the ``local`` database. -.. status:: locks.[database] +.. status:: locks. For each additional database :status:`locks` includes a document that reports on the lock use for this database. The names of these documents reflect the database name itself. -.. status:: locks.[database].timeLocked +.. status:: locks..timeLockedMicros - The :status:`locks.[database].timeLocked` document reports on the amount + The :status:`locks..timeLockedMicros` document reports on the amount of time in microseconds that locks have existed in the context of - the ``[database]`` database. + the ```` database. -.. status:: locks.[database].timeLocked.r +.. status:: locks..timeLockedMicros.r The ``r`` field reports the amount of time in microseconds that the - ``[database]`` database has held the read lock. + ```` database has held the read lock. -.. status:: locks.[database].timeLocked.w +.. status:: locks..timeLockedMicros.w The ``w`` field reports the amount of time in microseconds that the - ``[database]`` database has held the write lock. + ```` database has held the write lock. -.. status:: locks.[database].timeAcquiring +.. status:: locks..timeAcquiringMicros - The :status:`locks.[database].timeAcquiring` document reports on the + The :status:`locks..timeAcquiringMicros` document reports on the amount of time in microseconds that operations have spent waiting - to acquire a lock for the ``[database]`` database. + to acquire a lock for the ```` database. -.. status:: locks.[database].timeAcquiring.r +.. status:: locks..timeAcquiringMicros.r The ``r`` field reports the amount of time in microseconds that - operations have spent waiting a read lock on the ``[database]`` + operations have spent waiting a read lock on the ```` database. -.. status:: locks.[database].timeAcquiring.w +.. status:: locks..timeAcquiringMicros.w The ``w`` field reports the amount of time in microseconds that - operations have spent waiting a write lock on the ``[database]`` + operations have spent waiting a write lock on the ```` database. .. _globallock: +.. _global-lock: +.. _server-status-globallock: +.. _server-status-global-lock: globalLock ---------- +.. example:: output of the :ref:`globalLock ` fields. + .. status:: globalLock The :status:`globalLock` data structure contains information regarding @@ -363,10 +382,13 @@ globalLock.activeClients of active client connections performing write operations. .. _memory-status: +.. _server-status-memory: mem --- +.. example:: output of the :ref:`memory ` fields. + .. status:: mem The :status:`mem` data structure holds information regarding the target @@ -411,9 +433,13 @@ mem is likely to be to be roughly equivalent to the total size of your database or databases. +.. _server-status-connections: + connections ----------- +.. example:: output of the :ref:`connections ` fields. + .. status:: connections The :status:`connections` sub document data regarding the @@ -441,9 +467,15 @@ connections :status:`connections.current` to understand the connection load on the database. +.. _server-status-extra-info: +.. _server-status-extra_info: +.. _server-status-extrainfo: + extra_info ---------- +.. example:: output of the :ref:`extra_info ` fields. + .. status:: extra_info The :status:`extra_info` data structure holds data collected by the @@ -473,9 +505,13 @@ extra_info memory environments and larger data sets. Limited and sporadic page faults do not in and of themselves indicate an issue. +.. _server-status-indexcounters: + indexCounters ------------- +.. example:: output of the :ref:`indexCounters ` fields. + .. status:: indexCounters .. versionchanged:: 2.2 @@ -538,9 +574,14 @@ indexCounters :status:`indexCounters.btree.misses` misses. This value is typically ``0`` or approaching ``0``. +.. _server-status-backgroundflushing: +.. _server-status-background-flushing: + backgroundFlushing ------------------ +.. example:: output of the :ref:`backgroundFlushing ` fields. + .. status:: backgroundFlushing :program:`mongod` periodically flushes writes to disk. In the default @@ -597,9 +638,13 @@ backgroundFlushing Also consider ongoing operations that might skew this value by routinely block write operations. +.. _server-status-cursors: + cursors ------- +.. example:: output of the :ref:`cursors ` fields. + .. status:: cursors The :status:`cursors` data structure contains data regarding cursor state @@ -625,9 +670,13 @@ cursors this number is large or growing at a regular rate, this may indicate an application error. +.. _server-status-network: + network ------- +.. example:: output of the :ref:`network ` fields. + .. status:: network The :status:`network` data structure contains data regarding MongoDB's @@ -657,9 +706,13 @@ network :status:`network.bytesOut` values to ensure that MongoDB's network utilization is consistent with expectations and application use. +.. _server-status-repl: + repl ---- +.. example:: output of the :ref:`repl ` fields. + .. status:: repl The :status:`repl` data structure contains status information for @@ -701,11 +754,77 @@ repl See :doc:`/core/replication` for more information on replication. +.. _server-status-opcountersrepl: +.. _server-status-opcounters-repl: + +opcountersRepl +-------------- + +.. example:: output of the :ref:`opcountersRepl ` fields. + +.. status:: opcountersRepl + + The :status:`opcountersRepl` data structure, similar to the + :status:`opcounters` 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 :status:`opcounters` values + because of how MongoDB serializes operations during replication. + See :doc:`/core/replication` for more information on replication. + + These numbers will grow over time and in response to database + use. Analyze these values over time to track database utilization. + +.. status:: opcountersRepl.insert + + :status:`opcountersRepl.insert` provides a counter of the total number + of replicated insert operations since the :program:`mongod` instance + last started. + +.. status:: opcountersRepl.query + + :status:`opcountersRepl.query` provides a counter of the total number + of replicated queries since the :program:`mongod` instance last + started. + +.. status:: opcountersRepl.update + + :status:`opcountersRepl.update` provides a counter of the total number + of replicated update operations since the :program:`mongod` instance + last started. + +.. status:: opcountersRepl.delete + + :status:`opcountersRepl.delete` provides a counter of the total number + of replicated delete operations since the :program:`mongod` instance + last started. + +.. status:: opcountersRepl.getmore + + :status:`opcountersRepl.getmore` provides a counter of the total number + of "getmore" operations since the :program:`mongod` instance last + started. This counter can be high even if the query count is low. + Secondary nodes send ``getMore`` operations as part of the replication + process. + +.. status:: opcountersRepl.command + + :status:`opcountersRepl.command` provides a counter of the total number + of replicated commands issued to the database since the + :program:`mongod` instance last started. + +.. _server-status-replnetworkqueue: +.. _server-status-repl-network-queue: + replNetworkQueue ---------------- .. versionadded:: 2.1.2 +.. example:: output of the :ref:`replNetworkQueue ` fields. + .. status:: replNetworkQueue The :status:`replNetworkQueue` document reports on the network @@ -731,9 +850,13 @@ replNetworkQueue :status:`replNetworkQueue.numBytes` reports the total size of the network replication queue. +.. _server-status-opcounters: + opcounters ---------- +.. example:: output of the :ref:`opcounters ` fields. + .. status:: opcounters The :status:`opcounters` data structure provides an overview of @@ -780,65 +903,13 @@ opcounters of commands issued to the database since the :program:`mongod` instance last started. -opcountersRepl --------------- - -.. status:: opcountersRepl - - The :status:`opcountersRepl` data structure, similar to the - :status:`opcounters` 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 :status:`opcounters` values - because of how MongoDB serializes operations during replication. - See :doc:`/core/replication` for more information on replication. - - These numbers will grow over time and in response to database - use. Analyze these values over time to track database utilization. - -.. status:: opcountersRepl.insert - - :status:`opcountersRepl.insert` provides a counter of the total number - of replicated insert operations since the :program:`mongod` instance - last started. - -.. status:: opcountersRepl.query - - :status:`opcountersRepl.query` provides a counter of the total number - of replicated queries since the :program:`mongod` instance last - started. - -.. status:: opcountersRepl.update - - :status:`opcountersRepl.update` provides a counter of the total number - of replicated update operations since the :program:`mongod` instance - last started. - -.. status:: opcountersRepl.delete - - :status:`opcountersRepl.delete` provides a counter of the total number - of replicated delete operations since the :program:`mongod` instance - last started. - -.. status:: opcountersRepl.getmore - - :status:`opcountersRepl.getmore` provides a counter of the total number - of "getmore" operations since the :program:`mongod` instance last - started. This counter can be high even if the query count is low. - Secondary nodes send ``getMore`` operations as part of the replication - process. - -.. status:: opcountersRepl.command - - :status:`opcountersRepl.command` provides a counter of the total number - of replicated commands issued to the database since the - :program:`mongod` instance last started. +.. _server-status-asserts: asserts ------- +.. example:: output of the :ref:`asserts ` fields. + .. status:: asserts The :status:`asserts` data structure provides an account of the @@ -883,9 +954,14 @@ asserts after 2\ :superscript:`30` assertions. Use this value to provide context to the other values in the :status:`asserts` data structure +.. _server-status-writebacksqueued: +.. _server-status-write-backs-queued: + writeBacksQueued ---------------- +.. example:: output of the :ref:`writeBacksQueued ` fields. + .. status:: writeBacksQueued The value of :status:`writeBacksQueued` is ``true`` when there @@ -896,6 +972,7 @@ writeBacksQueued .. _durability-status: .. _journaling-status: +.. _server-status-journaling: dur --- @@ -905,6 +982,8 @@ dur Journaling ~~~~~~~~~~ +.. example:: output of the :ref:`journaling ` fields. + .. status:: dur The :status:`dur` (for "durability") data structure contains data @@ -1007,9 +1086,14 @@ timeMS milliseconds, the amount of time remapping copy-on-write memory mapped views. Smaller values indicate better journal performance. +.. _server-status-recordstats: +.. _server-status-record-stats: + recordStats ----------- +.. example:: output of the :ref:`recordStats ` fields. + .. versionadded::2.1.2 All :status:`recordStats` statuses first appeared in the 2.1.2 development release for the 2.2 series. @@ -1057,14 +1141,14 @@ recordStats number of page fault exceptions thrown by :program:`mongod` when accessing data for the ``admin`` database. -.. status:: recordStats.[database].accessNotInMemory +.. status:: recordStats..accessNotInMemory - :status:`recordStats.[database].accessNotInMemory` reflects the number of + :status:`recordStats..accessNotInMemory` reflects the number of times :program:`mongod` needed to access a memory page that was - *not* resident in memory for the ``[database]`` database. + *not* resident in memory for the ```` database. -.. status:: recordStats.[database].pageFaultExceptionsThrown +.. status:: recordStats..pageFaultExceptionsThrown - :status:`recordStats.[database].pageFaultExceptionsThrown` reflects the + :status:`recordStats..pageFaultExceptionsThrown` reflects the number of page fault exceptions thrown by :program:`mongod` when - accessing data for the ``[database]`` database. + accessing data for the ```` database.