MySQL status view QPS/TPS/cache hit rate view

mysql status view QPS/TPS/cache hit rate view 


To monitor the running mysql, one of the ways is to view the mysql running status.

(1) QPS (Queries per second)
QPS = Questions(or Queries) / seconds
mysql > show global status like 'Question%';

(2) TPS (Transactions per second)
TPS = (Com_commit + Com_rollback) / seconds
mysql > show global status like 'Com_commit';
mysql > show global status like 'Com_rollback';

(3) key Buffer hit rate
mysql>show global status like 'key%';
key_buffer_read_hits = (1-key_reads / key_read_requests) * 100%
key_buffer_write_hits = (1-key_writes / key_write_requests) * 100%

(4) InnoDB Buffer hit rate
mysql> show status like 'innodb_buffer_pool_read%';
innodb_buffer_read_hits = (1 - innodb_buffer_pool_reads / innodb_buffer_pool_read_requests) * 100%

(5) Query Cache hit rate
mysql> show status like 'Qcache%';
Query_cache_hits = (Qcahce_hits / (Qcache_hits + Qcache_inserts )) * 100%;

(6) Table Cache status Quantity
mysql> show global status like 'open%';
compare open_tables and opend_tables values

​​(7) Thread Cache hit rate
mysql> show global status like 'Thread%';
mysql> show global status like 'Connections';
Thread_cache_hits = (1 - Threads_created / connections ) * 100%

(8) Lock status
mysql> show global status like '%lock%';
Table_locks_waited/Table_locks_immediate=0.3% If this ratio is relatively large, it means that the blocking caused by table locks is more serious
Innodb_row_lock_waits innodb row lock, too large may be caused by gap lock

(9) replication delay
mysql > show slave status
to view delay time

(10) Tmp Table status (temporary table status)
mysql > show status like 'Create_tmp%';
The ratio of Created_tmp_disk_tables/Created_tmp_tables should not exceed 10%. If the value of Created_tmp_tables is relatively large,
it may be that there are too many sorting sentences or connecting sentences are not optimized enough

(11) Binlog Cache usage
mysql > show status like 'Binlog_cache%';
if the value of Binlog_cache_disk_use is not If it is 0, it may be necessary to increase the size of binlog_cache_size

(12) Innodb_log_waits amount
mysql > show status like 'innodb_log_waits';
If the value of Innodb_log_waits is not equal to 0, it indicates that the innodb log buffer is waiting because of insufficient space. For

example the command:
>#show global status;
although it can be Use:
>#show global status like %...%;
To filter, but corresponding to the long list, it is still necessary to clarify what each item means.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326933858&siteId=291194637