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

How to use mongostat monitoring tools in mongodb

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

Share

Shulou(Shulou.com)05/31 Report--

How to use mongostat monitoring tool in mongodb? I believe that many inexperienced people are helpless about this. For this reason, this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

mongostat is the status Detection Tools that mongodb comes with. When used on the command line, it will obtain the current running status of mongodb at fixed intervals and output it.

1. Mongostat Common Command Format:

mongostat --host 192.168.11.11:27017 --username root --password 12345678 --authenticationDatabase admin

mongostat Parameter Description:

--host : Specify IP address and port, or just write IP, and then specify port number with--port parameter

--username: If authentication is enabled, you need to fill in the username after it

--password : Not much, it must be password

--authenticationDatabase: If authentication is enabled, you need to fill in the authentication database after this parameter (note that it is the database for authenticating the above account)

command output format

2. Explanation of each field:

insert/s : The official interpretation is the number of objects inserted into the database per second. If it is slave, the value is preceded by *, indicating the replication set operation.

query/s : Number of query operations per second

update/s : Number of update operations per second

delete/s : Number of delete operations per second

getmore/s: Number of getmore operands per second querying cursor

command: The number of commands executed per second, two values are displayed in the master-slave system (e.g. 3| 0), subtable represents local| copy command

Note: The number of commands executed in one second, such as batch insertion, is only considered as one command (so it should not be significant)

dirty: only for WiredTiger engine, official website interpretation is the percentage of dirty data bytes cached

used: only for WiredTiger engine, official website explanation is the percentage of cache in use

flushes:

For WiredTiger engine: refers to the number of checkpoint triggers during a polling interval

For MMAPv1 engine: Number of times per second fsync is performed to write data to the hard disk

Note: Generally 0, discontinuity will be 1, by calculating the interval between two 1, you can roughly understand how long flush once. Flush costs a lot. If you flush frequently, you may have to find out the reason.

vsize: virtual memory usage in MB (this is the total data last invoked in mongostat)

res: physical memory usage in MB (this is the total data last invoked at mongostat)

Note: this is the same as what you see with top. vsize generally doesn't change much, res will rise slowly. If res often drops suddenly, check if there are other programs that use a lot of memory.

qr: Length of queue for clients waiting to read data from MongoDB instance

qw: Length of queue for clients waiting to write data from MongoDB instance

ar: Number of active clients performing read operations

aw: Number of live clients performing write operations

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

netIn: Network inbound traffic for MongoDB instances

netOut: network outbound traffic of MongoDB instance

Note: The table names of these two fields are network bandwidth pressure. Generally, it will not become a bottleneck.

conn: Total number of open connections, which is the sum of qr,qw,ar,aw

Note: MongoDB creates a thread for each connection, and thread creation and release also have overhead, so try to properly configure the startup parameter of the number of connections, maxIncomingConnections, Ali engineers suggest below 5000, basically meeting most scenarios

After reading the above, do you know how to use mongostat monitoring tools in mongodb? If you still want to learn more skills or want to know more related content, welcome to pay attention to the industry information channel, thank you for reading!

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