MySQL監控InnoDB Buffer Pool命中率
參加煉數成金的MySQL培訓,這是其中的一個作業題.
原來做過類似的監控
http://blog.itpub.net/29254281/viewspace-1222337/
首先,使用指令碼進行資料採集
vim /tmp/probe.sh
#!/bin/bash
#採集間隔時間,單位s
asleep=10
user=root
password=root
probe_file=probe.log
while [ 1 ] ; do
a=$(pt-mysql-summary --user $user --password $password --sleep $asleep | grep -i "Innodb_buffer_pool_read_requests\|Innodb_buffer_pool_reads" | awk '{if(length($3)==0) print 0 ;else print $3}'| tr -t '\n' ' ');
Innodb_buffer_pool_read_requests=$(echo $a | awk '{print $1}')
Innodb_buffer_pool_reads=$(echo $a | awk '{print $2}')
Innodb_buffer_read_hit_ratio=$(echo "scale=2; ((1 - $Innodb_buffer_pool_reads/$Innodb_buffer_pool_read_requests) * 100)" | bc)
echo $(date "+%Y-%m-%d_%H:%M:%S") $Innodb_buffer_read_hit_ratio >> $probe_file
done;
然後準備繪製圖形的指令碼
vim probe.gp
set terminal png size 3000,1000 font '/usr/share/fonts/wqy-zenhei/wqy-zenhei.ttc,14';
set yrange [0:100]
set size ratio 0.9 ;
set output '/tmp/probe.png' ;
set xdata time ;
set grid;
set timefmt '%Y-%m-%d_%H:%M:%S' ;
set xlabel "時間"
set ylabel "命中率"
plot '/tmp/probe.log' using 1:2 with line title 'InnoDB Buffer Pool命中率'
每次需要檢視InnoDB Buffer Pool命中率的時候,執行命令
原來做過類似的監控
http://blog.itpub.net/29254281/viewspace-1222337/
首先,使用指令碼進行資料採集
vim /tmp/probe.sh
#!/bin/bash
#採集間隔時間,單位s
asleep=10
user=root
password=root
probe_file=probe.log
while [ 1 ] ; do
a=$(pt-mysql-summary --user $user --password $password --sleep $asleep | grep -i "Innodb_buffer_pool_read_requests\|Innodb_buffer_pool_reads" | awk '{if(length($3)==0) print 0 ;else print $3}'| tr -t '\n' ' ');
Innodb_buffer_pool_read_requests=$(echo $a | awk '{print $1}')
Innodb_buffer_pool_reads=$(echo $a | awk '{print $2}')
Innodb_buffer_read_hit_ratio=$(echo "scale=2; ((1 - $Innodb_buffer_pool_reads/$Innodb_buffer_pool_read_requests) * 100)" | bc)
echo $(date "+%Y-%m-%d_%H:%M:%S") $Innodb_buffer_read_hit_ratio >> $probe_file
done;
然後準備繪製圖形的指令碼
vim probe.gp
set terminal png size 3000,1000 font '/usr/share/fonts/wqy-zenhei/wqy-zenhei.ttc,14';
set yrange [0:100]
set size ratio 0.9 ;
set output '/tmp/probe.png' ;
set xdata time ;
set grid;
set timefmt '%Y-%m-%d_%H:%M:%S' ;
set xlabel "時間"
set ylabel "命中率"
plot '/tmp/probe.log' using 1:2 with line title 'InnoDB Buffer Pool命中率'
每次需要檢視InnoDB Buffer Pool命中率的時候,執行命令
然後檢視繪製的圖形
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29734436/viewspace-1280664/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL innodb buffer pool 命中率以及快取了哪些 InnoDB TableMySql快取
- MySQL 引擎特性:InnoDB Buffer PoolMySql
- 【Mysql】mysql快速預熱innodb_buffer_poolMySql
- MySQL innodb_buffer_pool_size 變數MySql變數
- mysql 5.5 -- innodb buffer pool最佳化MySql
- mysql引數之innodb_buffer_pool_size大小設定MySql
- MySQL服務端innodb_buffer_pool_size配置引數MySql服務端
- 給從庫預熱innodb buffer pool
- MySQL 5.7新特性之動態修改innodb_buffer_pool大小MySql
- MySQL監控SQL狀態及命中率MySql
- 計算innodb_buffer_pool使用率
- ubuntu 命令列更改innodb_buffer_pool_sizeUbuntu命令列
- MySQL5.7 線上調整Innodb_Buffer_Pool_size不用重啟mysql程式薦MySql
- 【Mysql】讀書筆記之--innodb_buffer_pool記憶體的管理MySql筆記記憶體
- [MySQL5.6]Innodb新的監控表INNODB_METRICSMySql
- mysql 5.6效能監控表innodb_metricsMySql
- MySQL 8.0 Reference Manual(讀書筆記72節--InnoDB Buffer Pool Configuration (3))MySql筆記
- MySQL 8.0 Reference Manual(讀書筆記71節--InnoDB Buffer Pool Configuration (2))MySql筆記
- MySQL 8.0 Reference Manual(讀書筆記70節--InnoDB Buffer Pool Configuration (1))MySql筆記
- MySQL入門--記憶體buffer poolMySql記憶體
- Innodb特性之Read-Ahead(Buffer Pool Prefetching)
- MySQL中讀頁緩衝區buffer poolMySql
- 監控innodb status指標指標
- 計算mysql buffer的命中率及使用率MySql
- Oracle-監控緩衝區的命中率Oracle
- mysql innodb_log_file_size 和innodb_log_buffer_size引數MySql
- MySQL原理簡介—4.深入分析Buffer PoolMySql
- Mysql核心:INNODB儲存引擎--《十一》Insert BufferMySql儲存引擎
- shared_pool的sql命中率SQL
- MySQL怎麼緩解讀的壓力的?---buffer poolMySql
- MySQL監控工具MySql
- MySQL監控--zabbixMySql
- cacti監控mysqlMySql
- Innodb特性之change buffer
- 【Mysql】Mysql額外記憶體池 innodb_additional_mem_pool_sizeMySql記憶體
- mySQL5.6新特性快速預熱Buffer_Pool緩衝池MySql
- MySQL監控利器-InnotopMySql
- MySQL監控工具-orztopMySql