Super simple qps statistics method (recommended)

Super simple qps statistics method (recommended)

Statistics of QPS values ​​in the last N seconds (including select, insert, etc. per second)

mysql> select variable_name,sum(per_sec) as qps from (select straight_join lower(gs0.variable_name) as variable_name, (gs1.variable_value - gs0.variable_value)/5 as per_sec from ( select variable_name ,variable_value from information_schema.global_status where variable_name in ('com_select','com_update','com_insert','com_replace','com_delete') union all select '',sleep(5) from dual ) as gs0 join information_schema.global_status gs1 using (variable_name)) t group by variable_name with rollup;

+---------------+---------+
| variable_name | qps |
+---------------+---------+
| com_delete | 0 |
| com_insert | 2.2 |
| com_replace | 0 |
| com_select | 11524.8 |
| com_update | 3 |
| NULL | 11530 |
+---------------+---------+
6 rows in set (5.00 sec)

Statistics on qps value, number of slow queries, etc. since db was started

mysql> \s
--------------
mysql Ver 14.14 Distrib 5.5.35, for Linux (x86_64) using readline 5.1


Connection id: 98313987
Current database: udb
Current user: [email protected]
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.5.35-log MySQL Community Server (GPL) by Remi
Protocol version: 10
Connection: 172.23.9.201 via TCP/IP
Server characterset: utf8
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
TCP port: 3206
Uptime: 274 days 1 hour 22 minutes 29 seconds


Threads: 172 Questions: 7559640986 Slow queries: 150149138 Opens: 7799 Flush tables: 15 Open tables: 973 Queries per second avg: 319.261

The above super simple qps statistics method (recommended) is all the content that the editor shares with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM.

You may also be interested in:
  • The meaning and calculation method of QPS and TPS of MySQL database
  • What is the maximum number of concurrent connections on your IIS server?
  • Limit the number of concurrent connections per virtual host in Apache! ! ! !
  • Redis method to improve throughput through pipeline
  • How to improve throughput under high concurrency in springboot
  • What do TPS (throughput), QPS (query rate per second), concurrency, and RT (response time) mean?

<<:  Sample code for implementing music player with native JS

>>:  Detailed explanation of the construction and use of docker private warehouse

Recommend

The viewport in the meta tag controls the device screen css

Copy code The code is as follows: <meta name=&...

Detailed tutorial on configuring local yum source in CentOS8

The centos8 distribution is released through the ...

mysql5.6.zip format compressed version installation graphic tutorial

Preface: MySQL is a relational database managemen...

JavaScript anti-shake case study

principle The principle of anti-shake is: you can...

Detailed explanation of mysql5.6 master-slave setup and asynchronous issues

Table of contents 1. MySQL master-slave replicati...

The whole process of developing a Google plug-in with vue+element

Simple function: Click the plug-in icon in the up...

How to fix some content in a fixed position when scrolling HTML page

This article mainly introduces how some content i...

Detailed explanation of the new background properties in CSS3

Previously, we knew several attributes of backgro...

Six methods for nginx optimization

1. Optimize Nginx concurrency [root@proxy ~]# ab ...

calc() to achieve full screen background fixed width content

Over the past few years, there has been a trend i...

MySQL 8.0.21 installation steps and problem solutions

Download the official website First go to the off...

Let's talk in depth about the principle and implementation of new in JS

Table of contents definition Constructor bodies a...

Introduction to document.activeELement focus element in JavaScript

Table of contents 1. The default focus is on the ...

What does the n after int(n) in MySQL mean?

You may already know that the length 1 of int(1) ...