Mongodb:10-mongodb Monitoring _mongodb

Source: Internet
Author: User
Tags mongodb monitoring
After you have installed the deployment and allowed the MongoDB service, you must understand the MongoDB operation and see the performance of MongoDB. In this way, in the case of large flow can be a good response and ensure MongoDB normal operation. The Mongostat and mongotop two commands are provided in MongoDB to monitor the operation of MongoDB. Mongostat command

Mongostat is a MongoDB state detection tool that is used at the command line. It takes a fixed time to get the current running state of the MongoDB and outputs it. If you find that the database suddenly slows down or has other problems, your first-hand actions consider using Mongostat to view the status of the MONGO. Start your Mongod service, enter the bin directory under the MongoDB directory you installed, and enter the Mongostat command as follows:
D:\java\mongodb\server\3.4\bin>mongostat #以上命令输出结果如下: Insert query update delete getmore command dirty used flushes vs ize res qrw ARW net_in net_out conn time *0 *0 *0 *0 0 2|0 0.0% 0.0% 0 893M 98.0M 0|0 1|0 169b 48.9k 1 Oct 13 08:27:06.194 *0 *0 *0 *0 0 1|0 0.0% 0.0% 0 893M 98.0M 0|0 1|0 157b 45.6k 1 Oct 08:27:07.195 *0 *0 *0 *0 0 1|0 0.0% 0.0% 0 893M 98.0 M 0|0 1|0 156b 45.3k 1 Oct 08:27:08.203 *0 *0 *0 *0 0 2|0 0.0% 0.0% 0 893M 98.0M 0|0 1|0 159b 46.0k 1 Oct 13 08:27:09.1 Mongotop Order
Mongotop is also a built-in tool under MongoDB, Mongotop provides a way to track a MongoDB instance and see which amount of time is spent reading and writing data. Mongotop provides the level of statistics for each collection. By default, Mongotop returns every second of the value. Start your Mongod service, enter the bin directory under the MongoDB directory you installed, and enter the Mongotop command as follows:
D:\java\mongodb\server\3.4\bin>mongotop 2017-10-13t08:36:00.002+0800 connected to:127.0.0.1 NS Total Read write 2017-10-13t08:36:01+08:00 admin.system.roles 0ms 0ms 0ms admin.system.users 0ms 0ms 0ms admin.system.version 0ms 0ms 0ms L Ocal.startup_log 0ms 0ms 0ms local.system.replset 0ms 0ms 0ms mongotest.abc 0ms 0ms 0ms mongotest.b 0ms 0ms 0ms mongotest. C2 0ms 0ms 0ms mongotest.users 0ms 0ms 0ms 2017-10-13t08:36:01.974+0800 signal ' interrupt ' received; Forcefully terminating with parameter example
Mongotop 10 After 10 is the <sleeptime> parameter, you can not use, wait for the length of time in seconds, mongotop waiting for the call between. Returns every second of the data through the default mongotop.
Mongotop--locks reports the use of locks for each database, using Mongotop--locks, which produces the following output: Output result field Description: NS: Contains database namespaces, which combine database names and collections. DB: Contains the name of the database. Name is. Database for global locking, not for a specific database. total:mongod  spends the time working in this namespace to provide total. READ: Provides a lot of time for this mongod to spend on performing read operations in this namespace. Write: This mongod takes a lot of time to provide this namespace for writing.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.