Article link: HTTPS://BLOG.HHUI.TOP/HEXBLOG/2018/06/01/180601-MYSQL Performance monitoring Tool mytop/
MySQL Performance monitoring gadget mytop
Reference: How to use Mytop to Monitor MySQL performance
I. Installation and Configuration
Can be installed directly through Yum under Centos
yum install mytop
Use the same posture as the top command, directly
mytop
May prompt for no permissions, as follows
# mytop!500cannot Connect to M Ysql server. Please check the following: * Database you specified"Test" (Default is"Test") * username you specified"Root" (Default is"Root") * password you specified" (default is ") * hostname specified "localhost" (default is "localhost") * Port Specif IED "3306" (default is 3306) * Socket for specified "" (default is "") the options my being Specifie D on the command-line or in a ~/.mytopconfig file. See the Manual (Perldoc mytop) for details. Here's theexact error from DBI. It might help you debug:access denied for user ' root' @ ' localhost' (using Password:no) /c12>
Configuration file
With the tips above, you can add a configuration file
vim ~/.mytop## 配置信息如host=localhostuser=rootpass=mypwddb=dbNameport=3306# 刷新时间,5s刷新下delay=5batchmode=0color=1idle=1
Use Posture
Writing the password directly to the configuration file may not be very secure, and you can do the following
mytop --prompt# 然后再窗口内输入密码即可
If you do not want to add the above configuration, you can specify the db for parameter monitoring
mytop -d dbName --prompt
Ii. Monitoring and parameter description
After executing the above command, the window displays the following
MySQL on localhost (5.7.) Up345+19:27:20 [18:55:Queries]:778.2K QPS:0 Slow:0.0 se/in/up/de (%):72/20m02/QPS Now:1 Slow QPS:0.0 Threads:3 (1/6) 50/00/ 00/00 Key efficiency: 50.0% Bps in/out: 3.3/ 163.3 now in/out: 24.9/2.1k Id User host/ip DB time CMD Query or state----------------------- ---------568 root localhost story 0 Query show full processlist Span class= "hljs-number" >567 root localhost story 5 Sleep 541 root Localhost:44568 solo 3529 Sleep
1. Parameter description
First line
Queries: 778.2k qps: 0 Slow: 0.0 Se/In/Up/De(%): 72/00/02/00
Overall information:
- Total number of query processed by the Queries server
- Average number of query numbers processed by QPS per second
- Slow Number of Slow queries
- Se/in/up/de (%) Select,insert,update,delete the respective proportion
Second line
qps now: 1 Slow qps: 0.0 Threads: 3 ( 1/ 6) 50/00/00/00
Current QPS information:
- The number of query processing per second in the QPS now cycle
- Slow QPS number of slow queries per second during this cycle
- Threads the number of threads currently connected, the first number in parentheses after the active state, and the second number in the thread cache
- The last column is the respective ratio of select,insert,update,delete in this period
Third line
50.0% Bps in/out: 3.3/163.3 Now in/out: 24.9/ 2.1k
- Key efficiency: Indicates how many keys are read from the cache and not read from the disk
- Bps in/out: Indicates the average amount of incoming and outgoing data for MySQL
- Now In/out: is the amount of incoming and outgoing data during this period
Remaining
The following is the thread information
2. Common commands
Look at the details of the active thread and see what SQL is executing in this thread
- Press f, and then enter the thread ID
- Then e can view the SQL case
View summary of command executions
Need more commands to help
III. other Grey-grey blog:https://liuyueyi.github.io/hexblog
A gray and gray personal blog, recording all the study and work in the blog, welcome everyone to visit
Statement
The letter is not as good as, has been on the content, purely opinion, because of limited personal ability, inevitably there are omissions and errors, such as the detection of bugs or better suggestions, welcome criticism, please feel grateful
- Weibo address: small Gray Gray Blog
- QQ: A grey/grey/3302797840
Scan attention
180601-mysql Performance monitoring Tool Mytop