mysql檢視緩衝池命中率
緩衝池是一塊記憶體區域,在對資料庫進行讀取操作時,首先將資料從磁碟中讀取到緩衝池中,那緩衝池命中率則是客戶端請求的資料在直接在緩衝池獲取的比例。想象下如果緩衝池命中率很低,大部分資料都要從磁碟讀取,可想而知一個資料庫的效能。作為一個mysql OLTP系統,緩衝命中率最好在百分99以上。下面介紹幾種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> 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
可以看出系統的記憶體使用效率還是很高的
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29989552/viewspace-2116687/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL InnoDB緩衝池MySql
- InnoDB 中的緩衝池(Buffer Pool)
- MySQL 配置InnoDB變更緩衝MySql
- Mysql innodb引擎(一)緩衝和索引MySql索引
- [譯] part23: 緩衝channel和協程池
- 緩衝池裡的祕密,你不好奇嗎?
- MySQL中讀頁緩衝區buffer poolMySql
- 緩衝管理
- 設計模式(十二)——享元模式(Integer緩衝池原始碼分析)設計模式原始碼
- 輸出緩衝
- MYSQL 檢視MySql
- JavaScript 緩衝運動JavaScript
- Java™ 教程(緩衝流)Java
- 無緩衝阻塞 chan
- Java NIO:緩衝區Java
- stdio流緩衝區
- 雙緩衝學習
- 緩衝位元組流#
- 開關電源緩衝吸收電路:拓撲吸收、RC吸收、RCD吸收、鉗位吸收、無損吸收、LD緩衝、LR緩衝、飽和電感緩衝、濾波緩衝、振鈴_rc吸收和rcd吸收
- MySQL View 檢視MySqlView
- Golang併發程式設計有緩衝通道和無緩衝通道(channel)Golang程式設計
- 檢視ipad 電池健康度流程iPad
- Linux 命令 管道 緩衝區Linux
- Java NIO 之緩衝區Java
- Go 緩衝通道(bufchan)用法Go
- Java整數緩衝區Java
- CSAPP緩衝實驗buflabAPP
- Unity深度緩衝區指令Unity
- 緩衝帶裡的少年
- 前端筆記之JavaScript(十二)緩衝公式&檢測裝置&Data日期前端筆記JavaScript公式
- Duilib的雙緩衝實現,附帶GDI、WTL的雙緩衝實現UI
- MySQL檢視介紹MySql
- 管理mysql的檢視MySql
- MySQL 檢視簡介MySql
- 10_MySQL檢視MySql
- Java併發程式設計:4種執行緒池和緩衝佇列BlockingQueueJava程式設計執行緒佇列BloC
- Win10系統怎麼檢測電池和檢視電池檢測報告Win10
- MySQL Join原理分析(緩衝塊巢狀與索引巢狀迴圈)MySql巢狀索引
- PHP的輸出緩衝區PHP