Ultra-simple qps statistical methods (recommended) and qps statistical methods

Source: Internet
Author: User

Ultra-simple qps statistical methods (recommended) and qps statistical methods

Calculate the QPS value in the last N seconds (including the select and insert 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_inserts | 2.2 |
| Com_replace | 0 |
| Com_selected | 11524.8 |
| Com_update | 3 |
| NULL | 11530 |
+ --------------- + --------- +
6 rows in set (5.00 sec)

Statistics on qps and slow Query Count since db startup

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

The above simple qps statistical method (recommended) is all the content shared by Alibaba Cloud xiaobian. I hope to give you a reference and support for the customer's house.

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.