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 count QPS scripts in mysql database

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Let's talk about how to count QPS scripts in the mysql database. The secret of the text is that it is relevant to the topic. So, no gossip, let's go straight to the following, I believe you will benefit from reading this article on how to count QPS scripts in the mysql database.

#! / bin/bash

Mysqladmin-uroot-p'xxxx' extended-status-i1 | awk 'BEGIN {local_switch=0;print "QPS Commit Rollback TPS Threads_con Threads_run\ nMurray -"}

$2 ~ / Queries$/ {QQ stories 4MB LQ investors LQ shares 4;}

$2 ~ / Com_commit$/ {centering 4 Mustang 4 Muhammad 4;}

$2 ~ / Com_rollback$/ {rpm, 4MB, lr, lrc, lr, r, r, o, r, o,

$2 ~ / Threads_connected$/ {tc=$4;}

$2 ~ / Threads_running$/ {tr=$4

If (local_switch==0)

{local_switch=1;count=0}

Else {

If (count > 10)

{count=0;print "- -\ nQPS Commit Rollback TPS Threads_con Threads_run\ nMurray -" }

Else {

Count+=1

Printf "%-6d%-8d%-7d%-8d%-10d% d\ n"

}

}

}'

The result after execution is:

QPS Commit Rollback TPS Threads_con Threads_run

35 7 0 7 182 1

1 0 0 0 182 1

7 1 0 1 182 1

11 2 0 2 182 1

10 10 1 182 1

90 90 9 182 1

316 42 0 42 182 1

1 0 0 0 182 1

15 1 0 1 182 1

16 2 0 2 182 1

267 38 0 38 183 1

You can use this script to dynamically view the QPS of mysql and related information!

Is there anything you don't understand about how to count QPS scripts in the above mysql database? Or if you want to know more about it, you can continue to follow our industry information section.

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