Home > Web Front-end > JS Tutorial > Summary of qps statistical methods

Summary of qps statistical methods

php中世界最好的语言
Release: 2018-04-19 11:33:55
Original
2942 people have browsed it

This time I will bring you a summary of the qps statistical method. What are the precautions for the qps statistical method? The following is a practical case, let’s take a look.

Statistics of QPS values ​​in the last N seconds (including select, insert, etc. values ​​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)
Copy after login

Statistics on the qps value and slowness since db started QueryQuantity and other information

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:ucloud@172.23.0.48
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 min 29 sec
Threads: 172  Questions: 7559640986  Slow queries: 150149138  Opens: 
7799  Flush tables: 15  Open tables: 973  Queries per second avg: 
319.261
Copy after login

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to php Chinese Other related articles online!

Recommended reading:

JS implements data validation and check box form submission

JS easily implements carousel images

js regular fast memory method

The above is the detailed content of Summary of qps statistical methods. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template