MySQL数据库性能监控

OS层面

MySQL数据库性能监控_第1张图片

 

关注:r队列是否有过载的r线程以及是否使用swap空间,是swap in还是swap out

 

MySQL数据库性能监控_第2张图片

 

关注:IOPS(每秒进行读写操作的次数)的大小、平均等待时间、写性能是否变差、繁忙度

 

MySQL数据库性能监控_第3张图片

关注:top H命令按P键按照%CPU排序,关注是否有过载线程

MySQL数据库性能监控_第4张图片

 

数据库层面

1、数据库真实负载

mysql> show status like '%innodb_rows%';
+----------------------+-------+
| Variable_name        | Value |
+----------------------+-------+
| Innodb_rows_deleted  | 0     |
| Innodb_rows_inserted | 0     |
| Innodb_rows_read     | 8     |
| Innodb_rows_updated  | 0     |
+----------------------+-------+

2、IO相关

mysql> show status like '%innodb_pages_read%';
+-------------------+-------+
| Variable_name     | Value |
+-------------------+-------+
| Innodb_pages_read | 492   |
+-------------------+-------+

mysql> show status like '%innodb_buffer_pool_read%';
+---------------------------------------+-------+
| Variable_name                         | Value |
+---------------------------------------+-------+
| Innodb_buffer_pool_read_requests      | 1921  |
| Innodb_buffer_pool_reads              | 493   |
+---------------------------------------+-------+

mysql> show status like '%innodb_buffer_pool_pages_flushed%';
+----------------------------------+-------+
| Variable_name                    | Value |
+----------------------------------+-------+
| Innodb_buffer_pool_pages_flushed | 39    |
+----------------------------------+-------+

mysql> show status like '%innodb_buffer_pool_write%';
+-----------------------------------+-------+
| Variable_name                     | Value |
+-----------------------------------+-------+
| Innodb_buffer_pool_write_requests | 515   |
+-----------------------------------+-------+

3、内存相关

mysql> show status like '%innodb_buffer_pool_wait_free%';
+------------------------------+-------+
| Variable_name                | Value |
+------------------------------+-------+
| Innodb_buffer_pool_wait_free | 0     |
+------------------------------+-------+

mysql> show status like '%innodb_buffer_pool_pages_total%';
+--------------------------------+-------+
| Variable_name                  | Value |
+--------------------------------+-------+
| Innodb_buffer_pool_pages_total | 8191  |
+--------------------------------+-------+

mysql> show status like '%innodb_buffer_pool_pages_dirty%';
+--------------------------------+-------+
| Variable_name                  | Value |
+--------------------------------+-------+
| Innodb_buffer_pool_pages_dirty | 0     |
+--------------------------------+-------+

4、锁相关

mysql> show status like '%innodb_row_lock_waits%';
+-----------------------+-------+
| Variable_name         | Value |
+-----------------------+-------+
| Innodb_row_lock_waits | 0     |
+-----------------------+-------+

mysql> show status like '%innodb_row_lock_time%';
+--------------------------+-------+
| Variable_name            | Value |
+--------------------------+-------+
| Innodb_row_lock_time     | 0     |
| Innodb_row_lock_time_avg | 0     |
| Innodb_row_lock_time_max | 0     |
+--------------------------+-------+

 

 

 

你可能感兴趣的:(MySQL体系结构)