X

使用 MySQL status 查看是否還有 Query 進來

MySQL 想要看有沒有 Query 進來,使用 MySQL show processlist; 看紀錄可能不夠,要看 status 的數字比較準,不然微秒的看不見

使用 MySQL status 查看是否還有 Query 進來

MySQL status 看到詳細資訊如下:

mysql> status;
--------------
mysql Ver 14.14 Distrib 5.6.32-78.1, for debian-linux-gnu (x86_64) using 6.3

Connection id: 1006466959
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.6.32-78.1-log Percona Server (GPL), Release 78.1,
Revision 4c779b7
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /var/run/mysqld/mysqld.sock
Uptime: 1180 days 20 hours 11 min 36 sec

Threads: 3 Questions: 50320099254 Slow queries: 489806 Opens: 242974 Flush tables: 2 Open tables: 2048 Queries per second avg: 493.214

把一些雜訊去掉,大概要看的就是下述:

mysql> status;
--------------
Connection id: 1006466959
Server version: 5.6.32-78.1-log Percona Server (GPL)
Uptime: 1180 days 20 hours 11 min 36 sec
Threads: 3 Questions: 50320099254 Slow queries: 489806 Opens: 242974 Flush tables: 2 Open tables: 2048 Queries per second avg: 493.214

主要是看 Questions: 50320099254,這個數字若還有在增加,就代表有 Query 進來 (自己 status 應該也要算在裡面)

Tsung: 對新奇的事物都很有興趣, 喜歡簡單的東西, 過簡單的生活.
Related Post