mongotop (1) Linux Manual Page
NAME
mongotop – MongoDB Activity Monitor
SYNOPSIS
mongotop provides a method to track the amount of time a MongoDB instance spends reading and writing data. mongotop provides statistics on a per-collection level. By default, mongotop returns values every second.
SEE ALSO: For more information about monitoring MongoDB, see http://docs.mongodb.org/manual/administration/monitoring.
For additional background on various other MongoDB status outputs see:
- •
- http://docs.mongodb.org/manual/reference/command/serverStatus
- •
- http://docs.mongodb.org/manual/reference/command/replSetGetStatus
- •
- http://docs.mongodb.org/manual/reference/command/dbStats
- •
- http://docs.mongodb.org/manual/reference/command/collStats
For an additional utility that provides MongoDB metrics see
mongostat.
OPTIONS
mongotopmongotop–help, -h- Returns information on
mongotopoptions and usage. –verbose, -v- Increases the amount of internal reporting returned on standard output or in log files. Increase the verbosity with the
-vform by including the option multiple times, (e.g.-vvvvv.) –quiet- Runs
mongotopin a quiet mode that attempts to limit the amount of output. This option suppresses: - •
- output from database commands
- •
- replication activity
- •
- connection accepted events
- •
- connection closed events
–version- Returns the
mongotoprelease number. –host <hostname><:port>, -h- Specifies a resolvable hostname for the
mongodto which to connect. By defaultmongotopattempts to connect to a MongoDB instance running on the localhost on port number27017.To connect to a replica set, specify the replica set seed name and the seed list of set members. Use the following format:
<replica_set_name>/<hostname1><:port>,<hostname2:<port>,...
You can always connect directly to a single MongoDB instance by specifying the host and port number directly.
–port <port>- Specifies the port number when the MongoDB instance is not running on the standard port of
27017. You may also specify the port number using the–hostoption. –ipv6- Enables IPv6 support, which allows
mongotopto connect to the MongoDB instance using an IPv6 network. All MongoDB programs and processes, includingmongotop, disable IPv6 support by default. –ssl- New in version 2.6.
Enables connection to a
mongodormongosthat has SSL support enabled.The default distribution of MongoDB does not contain support for SSL. For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure-ssl.
–sslCAFile <filename>- New in version 2.6.
Specifies the
.pemfile that contains the root certificate chain from the Certificate Authority. Specify the file name of the.pemfile using relative or absolute paths.The default distribution of MongoDB does not contain support for SSL. For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure-ssl.
–sslPEMKeyFile <filename>- New in version 2.6.
Specifies the
.pemfile that contains both the SSL certificate and key. Specify the file name of the.pemfile using relative or absolute paths.This option is required when using the –ssl option to connect to a
mongodormongosthat hassslCAFileenabled withoutsslWeakCertificateValidation.The default distribution of MongoDB does not contain support for SSL. For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure-ssl.
–sslPEMKeyPassword <value>- New in version 2.6.
Specifies the password to de-crypt the certificate-key file (i.e. –sslPEMKeyFile). Use –sslPEMKeyPassword only if the certificate-key file is encrypted. In all cases,
mongotopwill redact the password from all logging and reporting output.If the private key in the PEM file is encrypted and you do not specify –sslPEMKeyPassword,
mongotopwill prompt for a passphrase. See ssl-certificate-password.The default distribution of MongoDB does not contain support for SSL. For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure-ssl.
–sslCRLFile <filename>- New in version 2.6.
Specifies the
.pemfile that contains the Certificate Revocation List. Specify the file name of the.pemfile using relative or absolute paths.The default distribution of MongoDB does not contain support for SSL. For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure-ssl.
–sslAllowInvalidCertificates- New in version 2.6.
Bypasses the validation checks for server certificates and allows the use of invalid certificates. When using the
sslAllowInvalidCertificatessetting, MongoDB logs as a warning the use of the invalid certificate.The default distribution of MongoDB does not contain support for SSL. For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure-ssl.
–sslFIPSMode- New in version 2.6.
Directs
mongotopto use the FIPS mode of the installed OpenSSL library. Your system must have a FIPS compliant OpenSSL library to use –sslFIPSMode.The default distribution of MongoDB does not contain support for SSL. For more information on MongoDB and SSL, see http://docs.mongodb.org/manual/tutorial/configure-ssl.
–username <username>, -u- Specifies a username with which to authenticate to a MongoDB database that uses authentication. Use in conjunction with the
–passwordand–authenticationDatabaseoptions. –password <password>, -p- Specifies a password with which to authenticate to a MongoDB database that uses authentication. Use in conjunction with the
–usernameand–authenticationDatabaseoptions. –authenticationDatabase <dbname>- New in version 2.4.
Specifies the database that holds the user’s credentials. If you do not specify an authentication database,
mongotopassumes that the database specified as the argument to the –db option holds the user’s credentials. –authenticationMechanism <name>- New in version 2.4.
Specifies the authentication mechanism. By default, the authentication mechanism is
MONGODB-CR, which is the MongoDB challenge/response authentication mechanism. In MongoDB Enterprise,mongotopalso includes support forGSSAPIto handle Kerberos authentication. See http://docs.mongodb.org/manual/tutorial/control-access-to-mongodb-with-kerberos-authentication for more information about Kerberos authentication. –locks- Toggles the mode of
mongotopto report on use of per-database locks. These data are useful for measuring concurrent operations and lock percentage. <sleeptime>- The final argument is the length of time, in seconds, that
mongotopwaits in between calls. By defaultmongotopreturns data every second.
FIELDS
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.
mongotop.ns- Contains the database namespace, which combines the database name and collection.
Changed in version 2.2: If you use the –locks, the
nsfield does not appear in themongotopoutput. mongotop.db- 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
mongotopwith the –locks option. mongotop.total- Provides the total amount of time that this
mongodspent operating on this namespace. mongotop.read- Provides the amount of time that this
mongodspent performing read operations on this namespace. mongotop.write- Provides the amount of time that this
mongodspent performing write operations on this namespace. mongotop.<timestamp>- Provides a time stamp for the returned data.
USE
By default mongotop connects to the MongoDB instance running on the localhost port 27017. However, mongotop can optionally connect to remote mongod instances. See the mongotop options for more information.
To force mongotop to return less frequently specify a number, in seconds at the end of the command. In this example, mongotop will return every 15 seconds.
mongotop 15
This command produces the following output:
connected to: 127.0.0.1
ns total read write 2012-08-13T15:45:40
test.system.namespaces 0ms 0ms 0ms
local.system.replset 0ms 0ms 0ms
local.system.indexes 0ms 0ms 0ms
admin.system.indexes 0ms 0ms 0ms
admin. 0ms 0ms 0ms
ns total read write 2012-08-13T15:45:55
test.system.namespaces 0ms 0ms 0ms
local.system.replset 0ms 0ms 0ms
local.system.indexes 0ms 0ms 0ms
admin.system.indexes 0ms 0ms 0ms
admin. 0ms 0ms 0ms
To return a mongotop report every 5 minutes, use the following command:
mongotop 300
To report the use of per-database locks, use mongotop –locks, which produces the following output:
$ mongotop --locks
connected to: 127.0.0.1
db total read write 2012-08-13T16:33:34
local 0ms 0ms 0ms
admin 0ms 0ms 0ms
. 0ms 0ms 0ms
AUTHOR
MongoDB Documentation Project
COPYRIGHT
2011-2014, MongoDB, Inc.
