After you have installed the deployment and allows MongoDB service, you must understand the operation of MongoDB and see MongoDB performance. This can be a good deal and to ensure the normal operation of MongoDB was under major traffic situation.
MongoDB provides a mongostat and mongotop two commands to monitor the operation of MongoDB.
mongostat is mongodb carrying state detection tool, use the command line. It will be a fixed time interval to get the current operating state mongodb, and outputs. If you find the database suddenly slow down or have other questions, you first-hand operation is considered mongostat to view the status of mongo.
Start your Mongod service, go to the bin directory of your installation directory MongoDB under, and then enter mongostat command as follows:
The above command output results are as follows:
A built-in tool mongotop also mongodb under, mongotop provides a method for tracking a MongoDB instance, and see what a lot of time spent reading and writing data. mongotop provide each horizontal set of statistics. By default, it mongotop return value every second.
Start your Mongod service, go to the bin directory of your installation directory MongoDB under, and then enter mongotop command as follows:
Execute the above command output is as follows:
Examples of parameters
Back 10 <sleeptime> parameter may not be used, the length of time to wait, in seconds, mongotop wait between calls. By default mongotop return data every second.
Lock usage reports for each database using mongotop - lock, which produces the following output:
Output Field Description:
Namespace contains the database, which is a combination of the database name and collections.
Name of the database contains. Database named. For Global Lock, rather than a specific database.
Time spent in this work mongod namespace of the total available.
It offers a lot of time, which mongod spent performing a read operation in this namespace.
This namespace provides a write operation, which mongod spent a lot of time.