这篇文章给大家分享的是有关mysql如何查看缓冲池命中率的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。
方法一:
mysql> show engine innodb status\G;
*************************** 1. row ***************************
Type: InnoDB
Name:
Status:
=====================================
2016-06-07 09:40:38 7f593136f700 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 6 seconds #以下信息是最近6秒的平均值
.............................................
.............................................
Buffer pool size 393208
Buffer pool size, bytes 6442319872
Free buffers 8807
Database pages 373575
Old database pages 137869
Modified db pages 43
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages made young 1132357, not young 92318292
2.33 youngs/s, 2496.75 non-youngs/s
Pages read 2127203, created 1317816, written 1762250
18.00 reads/s, 3.83 creates/s, 14.33 writes/s
Buffer pool hit rate 998 / 1000, young-making rate 0 / 1000 not 314 / 1000 #缓冲池命中率
结果:最近6秒缓冲池命中率是99.8%
方法二:
mysql> show global status like 'innodb%read%';
+---------------------------------------+-------------+
| Variable_name | Value |
+---------------------------------------+-------------+
| Innodb_buffer_pool_read_ahead_rnd | 0 |
| Innodb_buffer_pool_read_ahead | 839015 | #预读次数
| Innodb_buffer_pool_read_ahead_evicted | 0 |
| Innodb_buffer_pool_read_requests | 1497697965 | #从缓冲池中读取页的次数
| Innodb_buffer_pool_reads | 1227641 | #从物理磁盘读取页的次数
| Innodb_data_pending_reads | 0 |
| Innodb_data_read | 34861846528 | #总共读入的字节数
| Innodb_data_reads | 2128711 | #总共读取的次数
| Innodb_master_thread_active_loops | 63667 |
| Innodb_master_thread_idle_loops | 24896 |
| Innodb_pages_read | 2127692 |
| Innodb_rows_read | 803908452 |
| Innodb_read_views_memory | 2176 |
+---------------------------------------+-------------+
13 rows in set (0.00 sec)
缓冲池命中率= Innodb_buffer_pool_read_requests/(Innodb_buffer_pool_read_requests+Innodb_buffer_pool_reads+Innodb_buffer_pool_read_ahead)=1497697965/(1497697965+1227641+839015)=99.85%
平均读取的字节数=Innodb_data_read/ Innodb_data_reads=16376
可以看出系统的内存使用效率还是很高的
感谢各位的阅读!关于“mysql如何查看缓冲池命中率”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。