Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Analysis of the Field meaning of the mongostat of mongodb

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

As a sharp tool for real-time monitoring of mongodb, mongostat is definitely a sharp knife, simple and easy to use, but if you want to carefully analyze the status of mongostat, you have to deeply understand the significance of each monitoring item.

# mongostatinsert query update delete getmore command flushes mapped vsize res faults locked% idx miss% qr | qw ar | aw netIn netOut conn set repl time * 79 87 * 0 * 0.013 | 0 0354g 710g 10.2g 9 000 | 0 0 | 0 9k 666k 483 c56. SEC 15:07:17

The meaning of each item is analyzed below:

Inserts/s inserts per second query/s queries per second update/s updates per second

Note: 10 simple queries may be faster than one complex query, so the size of the value does not make much sense. But at least you can know if the query is being processed and whether it is being inserted. If it is slave, the value is usually preceded by a *, which represents a replicate operation.

The number of commands per second for the getmore operation command/s of the cursor when querying getmore/s. In the master-slave system, two values are displayed (for example: 80 | 0), which represent the local number of replicated commands.

Note: the number of commands executed in a second, such as batch insertion, is considered to be a command with little significance. If it is slave, two values, local | replicated, will be displayed. By comparing these two values, you may be able to see some problems.

The number of times per second that flushs/s executes fsync to write data to the hard disk.

Note: it is usually 0, or 1. By calculating the interval between the two 1s, you can roughly understand how long it takes to flush. Flush costs a lot, and if you have frequent flush, you may have to find out why.

The total amount of data that is mmap in mapped/s, in MB (this is the total data last called in mongostat) vsize virtual memory usage, in MB (this is the total data in mongostat last call) res physical memory usage in MB (this is the total data in mongostat last call)

Note: this is the same as what you can see with top, mapped, vsize generally will not change much, res will rise slowly, if res often suddenly drop, check to see if there are other programs eating memory.

The number of faults/s access failures per second (only Linux has), and the data is swapped out of physical memory and put into swap.

Note: do not exceed 100. otherwise, the machine memory is too small, resulting in frequent swap writes. At this point, to upgrade memory or expand, this value is often not 0 under high pressure. If it is often not 0, it is time to add memory.

Recommended article: http://huoding.com/2011/08/19/107

The percentage of time locked% is locked up, try to keep it below 50%.

Note: MongoDB is only a read-write lock, which refers to the percentage of time that the write lock resides. If this number is too large (often more than 10%), something is wrong.

Idx miss% access to the percentage of attempts that require a page failure when loading btree nodes.

Note: this is a sampling value. If it is too high, then consider whether the index is less, very important parameters, normally, all queries should pass the index, that is, idx miss is 0. If the value here is large, is there a lack of index?

The length of the queue at which the qr client waits to read data from the MongoDB instance. The length of the queue at which the qw client waits to write data to the MongoDB instance. The number of active clients that ar performed read operations. The number of active clients that aw performed write operations.

Note: if these two values are large, then DB is blocked and the processing speed of DB is not as fast as the request speed. See if there are expensive slow queries. If everything is normal and the load is really heavy, you need to add the machine.

NetIn The amount of network traffic, inbytes, received by the MongoDB instance.This includes traffic from mongostat itself.netOut The amount of network traffic, inbytes, sent by the MongoDB instance.This includes traffic from mongostat itself.

Note: network bandwidth pressure, general MongoDB, the network will not become a bottleneck

Total number of conn open connections.

Note: MongoDB creates a thread for each connection, and thread creation and release also have overhead. Try not to let this number be too large.

The name of the set replica set. Replication status of the repl node.

Note:

M-master

SEC-secondary

REC-recovering

UNK-unknown

SLV-slave

Time timestamp

Recommended articles; http://www.cnblogs.com/zhuque/archive/2013/03/29/2988577.html

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report