innodb命中率评估

innodb  内存评估原则

通常InnoDB存储引擎的缓冲池的命中率不应该小于99%。
 

缓冲池命中率 = (Innodb_buffer_pool_read_requests)/(Innodb_buffer_pool_read_requests + Innodb_buffer_pool_read_ahead + Innodb_buffer_pool_reads)

                                    innodb_buffer_pool_read_requests
命中率 =-------------------------------------------------------------------------------------------------
         (innodb_bufer_pool_read_requests + innodb_buffer_pool_read_ahead + innodb_buffer_pool_reads )


平均每次读取的字节数 = Innodb_data_read/Innodb_data_reads

Innodb_buffer_pool_reads:表示从物理磁盘读取的页数
Innodb_buffer_pool_read_ahead:预读的页数
Innodb_buffer_pool_read_ahead_evicted:预读的页数,但是没有被读取就从缓冲池中被替换的页的数量,一般用来判断预读的效率。
Innodb_buffer_pool_read_requests:从缓冲池中读取的次数。
Innodb_data_read:总共读入的字节数。
Innodb_data_reads:发起读请求的次数,每次读取可能需要读取多个页。
 


 

mysql> show global status like 'innodb%read%';


Innodb_buffer_pool_read_ahead_rnd	0
Innodb_buffer_pool_read_ahead	651270
Innodb_buffer_pool_read_ahead_evicted	792
Innodb_buffer_pool_read_requests	6652087462
Innodb_buffer_pool_reads	1643398
Innodb_data_pending_reads	0
Innodb_data_read	42994913280
Innodb_data_reads	2635909
Innodb_pages_read	2624075
Innodb_rows_read	6299272374

 

                                    innodb_buffer_pool_read_requests
命中率 =-------------------------------------------------------------------------------------------------
         (innodb_bufer_pool_read_requests + innodb_buffer_pool_read_ahead + innodb_buffer_pool_reads )

 

                 6644810356
命中率 = ---------------------------- = 99.96% 约接近 1 越好 (证明内存足够)
           6644810356 + 651270 + 1643325

 

你可能感兴趣的:(mysql)