1. What is QPS and TPS?
QPS is the number of queries processed by MySQL per second
TPS is the number of transactions that MySQL processes per second
2.QPS and TPs How to ask?
QPS = Questions/uptime
TPS = (com_commit + com_rollback)/Uptime
For variable interpretation:
Total number of queries Questions:mysql
Run time of Uptime:mysql
Com_commit: Total Submissions
Com_rollback: Total rollback
3. How do I request QPS and TPS through shell scripting?
Create a shell directory under/etc/zabbix directory
Mkdir/etc/zabbix/shell && Cd/etc/zabbix/shell
Write scripts, execute scripts, pass arguments, call functions to query the corresponding results
Vim monitor_mysql.sh
#!/bin/bashuptime= ' mysqladmin status | awk ' {print $} ' QPS () {questions= ' mysqladmin status | awk ' {print $6} ' awk ' begin{printf '%.2f\n ', ' $Questions '/ ' $Uptime '} ' #TPSTPS () {rollback= ' mysqladmin extended-status | awk '/\<com_rollback\>/{print $4} ' commit= ' Mys Qladmin Extended-status | awk '/\<com_commit\>/{print $4} ' awk ' begin{printf '%.2f\n ', ' $ (($rollback + $commit)) '/' $Uptime '} '}$1
4. In the agent definition template
Vim userparameter_my.conf
Userparameter=monitor_mysql[*],/bin/bash/etc/zabbix/shell/monitor_mysql.sh "$"
Parameter explanation:
Monitor_mysql[*]: is a custom key,* is a parameter
After that, execute the script.
5.zabbix Web-side Create monitoring template
Create a monitoring template
Create a monitoring item Qps,key value parameter call the QPS function
Create a monitoring item Tps,key value parameters call the TPS function
Create a graphic
Link the template file to the host and view it in the drawing
6.prepare to update a topic on Zabbix monitoring, Welcome to join our Linux Technology Exchange Group: 642921645, we do not regularly update a lot of information about the system operations in the group, look forward to your joining!
Zabbix enterprise level monitoring MySQL TPS and QPS