Viewing the status of MongoDB

Source: Internet
Author: User
Tags mongodb commands

1, Mongotop

#mongotop-H 127.0.0.1:27017-u test-p test123--authenticationdatabase Admin

Output Description:

    • NS: Contains the database namespace, which combines the database name and collection.
    • DB: Contains the name of the database. Name is. Database against a global lock, not a specific database.
    • Total:mongod spends the time working in this namespace to provide the total.
    • READ: Provides a lot of time for this mongod to be spent in performing read operations in this namespace.
    • Write: Provides this namespace for writing, which Mongod spend a lot of time.

2, Mongostat

#mongostat-H 127.0.0.1:27017-u test-p test123--authenticationdatabase Admin

    • INSERTS/S number of insertions per second
    • QUERY/S number of queries per second
    • UPDATE/S Update times per second
    • DELETE/S number of deletions per second
    • GETMORE/S number of Getmore executed per second
    • command/s command number per second, more than the above insert, find, UPDATE, delete more comprehensive, also counted other commands
    • FLUSHS/S the number of times per second that Fsync data is written to the hard disk.
    • MAPPED/S The amount of data that is mmap, in megabytes,
    • Vsize Virtual memory usage, Unit MB
    • Res Physical memory usage, Unit MB
    • FAULTS/S the number of access failures per second (Linux only), the data is swapped out for physical memory and placed in swap. Do not exceed 100, otherwise the machine memory is too small, causing frequent swap writes. To upgrade the memory or expand it at this time
    • Locked% Locked time percentage, try to control it below 50%
    • IDX Miss% index Miss percentage. If it's too high, consider whether the index is less.
    • q t|r|wWhen MongoDB receives too many commands and the database is locked for completion, it joins the command into the queue. This column shows the length of the total, read, and write 3 queues, all of which are 0 words MONGO no pressure. When high concurrency occurs, the general queue value is raised.
    • Conn Current number of connections
    • Time timestamp

3. View current option

Mongodb commands are generally completed very quickly, but in a busy machine or with a slow command, you can get the currently executing operation via Db.currentop (), and on a machine with no load, the command basically returns empty.

>db.currentop ()

{ "opid" : "shard3:466404288", "active" : false, "waitingForLock" : false, "op" : "query", "ns" : "sd.usersEmails", "query" : { }, "client_s" : "10.121.13.8:34473", "desc" : "conn" },

If you find an operation that is too long and the database is stuck, you can kill him with the following command:

>db.killop ("shard3:466404288")

Viewing the status of MongoDB

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.