Zabbix enterprise level monitoring MySQL TPS and QPS

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.