mysql> SHOW GLOBAL STATUS LIKE 'Innodb_buffer_pool_pages_data'; +-------------------------------+-------+| Variable_name | Value |+-------------------------------+-------+| Innodb_buffer_pool_pages_data | 1388 |+-------------------------------+-------+1 row in set (0.00 sec)
mysql> SHOW GLOBAL STATUS LIKE 'Innodb_buffer_pool_pages_total';+--------------------------------+--------+| Variable_name | Value |+--------------------------------+--------+| Innodb_buffer_pool_pages_total | 131071 |+--------------------------------+--------+1 row in set (0.00 sec)
mysql> SHOW GLOBAL STATUS LIKE 'Innodb_page_size';+------------------+-------+| Variable_name | Value |+------------------+-------+| Innodb_page_size | 16384 |+------------------+-------+1 row in set (0.00 sec)'Innodb_buffer_pool_pages_data' X 100 / 'Innodb_buffer_pool_pages_total'
当结果 > 95% 则增加 innodb_buffer_pool_size, 建议使用 ram total 75%当结果 < 95% 则减少 innodb_buffer_pool_size, 建议 'Innodb_buffer_pool_pages_data' X 'Innodb_page_size' X 1.05 / (1024*1024*1024)