1024programmer Java MongoDB3.2 tool Mongostat

MongoDB3.2 tool Mongostat

This tool provides an overview of the current running status of mongod and mongos
Common command format:

mongostat –host 192.168.1.100:27017 -uroot -p123456 –authenticationDatabase admin
Parameter description:
host: Specify the IP address and port, or just write the IP, and then use the –port parameter to specify the port number
-u: If authentication is turned on, you need to fill in the user name afterwards
-p: It doesn’t take much, it must be the password
–authenticationDatabase: If authentication is turned on, you need to fill in the authentication database after this parameter (note that it is the database that authenticates the above account)

Command output format:
MongoDB3.2 tool---Mongostat


Explanation of each field:
insert/s: The official explanation is the number of objects inserted into the database per second. If it is a slave, there is an * in front of the value, which means a copy 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 operations when querying cursor (cursor) per second
command: The number of commands executed per second. Two values ​​will be displayed in the master-slave system (for example, 3|0). The sub-table represents the local|replication command
Note: The number of commands executed in one second, such as batch insertion, is only considered one command (so it should not be of much significance)
dirty: only for WiredTiger engine, the official website explains that it is the cache percentage of dirty data bytes
used: only for the WiredTiger engine, the official website explains that it is the cache percentage 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 to execute fsync to write data to the hard disk
Note: Generally it is 0, and the intermittent value will be 1. By calculating the interval between two 1’s, you can roughly understand how often a flush occurs. The flush overhead is very high. If you flush frequently, you may have to find the reason.
vsize: Virtual memory usage, unit MB (this is the total data in the last call of mongostat)

res: Physical memory usage, unit MB (this is the total data in the last call of mongostat)

Note: This is the same as what you see with top. Generally, vsize will not change significantly, and res will slowly rise. If res often drops suddenly, check to see if there are other programs that are eating up memory.

qr: The length of the queue where the client is waiting to read data from the MongoDB instance.
qw: Queue length for clients to wait for data to be written from the 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 the DB is blocked and the processing speed of the DB is not as fast as the request speed. See if there are any expensive slow queries. If the query is all normal, the load is indeed very heavy, and you need to add more machines
netIn: MongoDB instance network incoming traffic
netOut: Network outgoing traffic of the MongoDB instance
Note: These two fields represent network bandwidth pressure. Under normal circumstances, they will not become a bottleneck.
conn: The total number of open connections, which is the sum of qr, qw, ar, and aw
Note: MongoDB creates a thread for each connection. The creation and release of threads will also have overhead, so try to appropriately configure the startup parameters for the number of connections, maxIncomingConnections. Alibaba engineers recommend that it be below 5000, which basically meets most scenarios
(Theft Take a screenshot of Youdong’s PPT)
MongoDB3.2 Tool---Mongostat

set: the name of the replica set
repl: the replication status of the node
M —master
SEC —secondary
REC   —recovering
UNK —unknown
SLV —slave
RTR —mongs process(“router’)
ARB —arbiter

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/749440

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索