mongostat returns values that reflect the operations over a 1 second period. When mongostat <sleeptime> has a value greater than 1, mongostat averages the statistics to reflect average operations per second.
mongostat outputs the following fields:
The number of objects inserted into the database per second. If followed by an asterisk (e.g. *), the datum refers to a replicated operation.
The number of query operations per second.
The number of update operations per second.
The number of delete operations per second.
The number of get more (i.e. cursor batch) operations per second.
The number of commands per second. On slave and secondary systems, mongostat presents two values separated by a pipe character (e.g. |), in the form of local|replicated commands.
Changed in version 3.0.0.
For the WiredTiger Storage Engine, flushes refers to the number of WiredTiger checkpoints triggered between each polling interval.
For the MMAPv1 Storage Engine, flushes represents the number of fsync operations per second.
New in version 3.0.0.
Only for WiredTiger Storage Engine. The percentage of the WiredTiger cache with dirty bytes.
New in version 3.0.0.
Only for WiredTiger Storage Engine. The percentage of the WiredTiger cache that is in use.
Changed in version 3.0.0.
Only for MMAPv1 Storage Engine. The total amount of data mapped in megabytes. This is the total data size at the time of the last mongostat call.
The amount of virtual memory in megabytes used by the process at the time of the last mongostat call.
Changed in version 3.0.0.
Only for MMAPv1 Storage Engine.
Optional. The total amount of virtual memory excluding all mapped memory at the time of the lastmongostat call.
mongostat only returns this value when started with the --all option.
The amount of resident memory in megabytes used by the process at the time of the last mongostatcall.
Changed in version 3.0.0.
Only for MMAPv1 Storage Engine. The number of page faults per second.
Changed in version 2.1: Before version 2.1, this value was only provided for MongoDB instances running on Linux hosts.
Changed in version 3.0.0: Only appears when mongostat runs against pre-3.0 versions of MongoDB instances.
The percent of time in a global write lock.
Changed in version 2.2: The locked db field replaces the locked % field to more appropriate data regarding the database specific locks in version 2.2.
Changed in version 3.0.0.
Only for MMAPv1 Storage Engine. The percent of index access attempts that required a page fault to load a btree node. This is a sampled value.
The length of the queue of clients waiting to read data from the MongoDB instance.
The length of the queue of clients waiting to write data from the MongoDB instance.
The number of active clients performing read operations.
The number of active clients performing write operations.
The amount of network traffic, in bytes, received by the MongoDB instance.
This includes traffic from mongostat itself.
The amount of network traffic, in bytes, sent by the MongoDB instance.
This includes traffic from mongostat itself.
The total number of open connections.
The name, if applicable, of the replica set.
The replication status of the member.
mongotop returns time values specified in milliseconds (ms.)
mongotop only reports active namespaces or databases, depending on the --locks option. If you don’t see a database or collection, it has received no recent activity. You can issue a simple operation in the mongo shell to generate activity to affect the output of mongotop.
Contains the database namespace, which combines the database name and collection.
Changed in version 2.2: If you use the mongotop --locks, the ns field does not appear in the mongotopoutput.
New in version 2.2.
Contains the name of the database. The database named . refers to the global lock, rather than a specific database.
This field does not appear unless you have invoked mongotop with the --locks option.
Provides the total amount of time that this mongod spent operating on this namespace.
Provides the amount of time that this mongod spent performing read operations on this namespace.
Provides the amount of time that this mongod spent performing write operations on this namespace.
Provides a time stamp for the returned data.
A description of the client. This string includes the connectionId.
An identifier for the thread that handles the operation and its connection.
An identifier for the connection where the operation originated.
The identifier for the operation. You can pass this value to db.killOp() in the mongo shell to terminate the operation.
WARNING
Terminate running operations with extreme caution. Only use db.killOp() to terminate operations initiated by clients and do not terminate internal database operations.
A boolean value specifying whether the operation has started. Value is true if the operation has started or false if the operation is idle, such as an idle connection or an internal thread that is currently idle. An operation can be active even if the operation has yielded to another operation.
Changed in version 3.0: For some inactive background threads, such as an inactivesignalProcessingThread, MongoDB suppresses various empty fields.
The duration of the operation in seconds. MongoDB calculates this value by subtracting the current time from the start time of the operation.
Only appears if the operation is running; i.e. if active is true.
New in version 2.6.
The duration of the operation in microseconds. MongoDB calculates this value by subtracting the current time from the start time of the operation.
Only appears if the operation is running; i.e. if active is true.
A string that identifies the type of operation. The possible values are:
"query" operations include read operations as well as most commands such as the createIndexescommand and the findandmodify command.
Changed in version 3.0: Write operations that use the insert, update, and delete commands respectively display "insert", "update", and "delete" for op. Previous versions include these write commands under "query" operations.
The namespace the operation targets. A namespace consists of the database name and the collectionname concatenated with a dot (.); that is, "<database>.<collection>".
Contains the document to be inserted for operations with op value of "insert". Only appears for operations with op value "insert".
Insert operations such as db.collection.insert() that use the insert command will have opvalue of "query".
A document containing information on operations whose op value is not "insert". For instance, for adb.collection.find() operation, the query contains the query predicate.
query does not appear for op of "insert". query can also be an empty document.
For "update" or "remove" operations or for read operations categorized under "query", the querydocument contains the query predicate for the operations.
Changed in version 3.0.4: For "getmore" operations on cursors returned from adb.collection.find() or a db.collection.aggregate(), the query field contains respectively the query predicate or the issued aggregate command document. For details on theaggregate command document, see the aggregate reference page.
For other commands categorized under "query", query contains the issued command document. Refer to the specific command reference page for the details on the command document.
Changed in version 3.0: Previous versions categorized operations that used write commands under opof "query" and returned the write command information (e.g. query predicate, update statement, and update options) in query document.
A string that contains the query plan to help debug slow queries.
The IP address (or hostname) and the ephemeral port of the client connection where the operation originates. If your inprog array has operations from many different clients, use this string to relate operations to clients.
Changed in version 3.0.
The locks document reports the type and mode of locks the operation currently holds. The possible lock types are as follows:
The possible modes are as follows:
Returns a boolean value. waitingForLock is true if the operation is waiting for a lock and false if the operation has the required lock.
The msg provides a message that describes the status and progress of the operation. In the case of indexing or mapReduce operations, the field reports the completion percentage.
Reports on the progress of mapReduce or indexing operations. The progress fields corresponds to the completion percentage in the msg field. The progress specifies the following information:
Reports the number completed.
Reports the total number.
Returns true if the operation is currently flagged for termination. When the operation encounters its next safe termination point, the operation will terminate.
numYields is a counter that reports the number of times the operation has yielded to allow other operations to complete.
Typically, operations yield when they need access to data that MongoDB has not yet fully read into memory. This allows other operations that have data in memory to complete quickly while MongoDB reads in data for the yielding operation.
Specifies if database is currently locked for fsync write/snapshot.
Only appears if locked; i.e. if fsyncLock is true.
Information regarding how to unlock database from db.fsyncLock(). Only appears if fsyncLock istrue.
For each lock type and mode (see currentOp.locks for descriptions of lock types and modes), returns the following information:
Number of times the operation acquired the lock in the specified mode.
Number of times the operation had to wait for the acquireCount lock acquisitions because the locks were held in a conflicting mode. acquireWaitCount is less than or equal toacquireCount.
Cumulative time in microseconds that the operation had to wait to acquire the locks.
timeAcquiringMicros divided by acquireWaitCount gives an approximate average wait time for the particular lock mode.
Number of times the operation encountered deadlocks while waiting for lock acquisitions.
Contains the name of the database.
Contains a count of the number of collections in that database.
Contains a count of the number of objects (i.e. documents) in the database across all collections.
The average size of each document in bytes. This is the dataSize divided by the number of documents.
The total size in bytes of the data held in this database including the padding factor. The scaleargument affects this value. The dataSize will not decrease when documents shrink, but will decrease when you remove documents.
The total amount of space in bytes allocated to collections in this database for document storage. Thescale argument affects this value. The storageSize does not decrease as you remove or shrink documents.
Contains a count of the number of extents in the database across all collections.
Contains a count of the total number of indexes across all collections in the database.
The total size in bytes of all indexes created on this database. The scale arguments affects this value.
The total size in bytes of the data files that hold the database. This value includes preallocated space and the padding factor. The value of fileSize only reflects the size of the data files for the database and not the namespace file.
The scale argument affects this value. Only present when using the mmapv1 storage engine.
The total size of the namespace files (i.e. that end with .ns) for this database. You cannot change the size of the namespace file after creating a database, but you can change the default size for all new namespace files with the nsSize runtime option.
Only present when using the mmapv1 storage engine.
SEE ALSO
The nsSize option, and Maximum Namespace File Size
New in version 2.4.
Document that contains information about the on-disk format of the data files for the database. Only present when using the mmapv1 storage engine.
New in version 2.4.
The major version number for the on-disk format of the data files for the database. Only present when using the mmapv1 storage engine.
New in version 2.4.
The minor version number for the on-disk format of the data files for the database. Only present when using the mmapv1 storage engine.
New in version 3.0.0.
New in version 3.0.0.
Number of extents in the freelist. Only present when using the mmapv1 storage engine.
New in version 3.0.0.
Total size of the extents on the freelist.
The scale argument affects this value. Only present when using the mmapv1 storage engine.