您好,登錄后才能下訂單哦!
這篇文章給大家分享的是有關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進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。