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

Use CSS to set the width of INPUT in TD

Recently, when I was using C# to make a Web progra...

Detailed explanation of the six common constraint types in MySQL

Table of contents Preface 1.notnull 2. unique 3. ...

Mysql SQL statement operation to add or modify primary key

Add table fields alter table table1 add transacto...

CocosCreator ScrollView optimization series: frame loading

Table of contents 1. Introduction 2. Analysis of ...

Sample code for implementing 3D book effect with CSS

Without further ado, let's take a look at the...

How to change the dot in the WeChat applet swiper-dot into a slider

Table of contents background Target Effect Ideas ...

Summary of the most commonly used knowledge points about ES6 new features

Table of contents 1. Keywords 2. Deconstruction 3...

Detailed explanation of Vue's SSR server-side rendering example

Why use Server-Side Rendering (SSR) Better SEO, s...

Analyzing the node event loop and message queue

Table of contents What is async? Why do we need a...

How to reduce image size using Docker multi-stage build

This article describes how to use Docker's mu...

Detailed explanation of how to adjust Linux command history

The bash history command in Linux system helps to...

How to make your browser talk with JavaScript

Table of contents 1. The simplest example 2. Cust...

How to quickly modify the root password under CentOS8

Start the centos8 virtual machine and press the u...

Sliding menu implemented with CSS3

Result:Implementation code: <!DOCTYPE html>...