Skip to main content

Mysql innodb cache info

Vérifier taille Buffer Pool Size:

mysql
SELECT FORMAT (BufferPoolPages*PageSize/POWER(1024,3),2) BufferPoolDataGB FROM (SELECT variable_value BufferPoolPages FROM information_schema.global_status WHERE variable_name ='Innodb_buffer_pool_pages_total') A, (SELECT variable_value PageSize FROM information_schema.global_status WHERE variable_name ='Innodb_page_size') B;

image.png

Vérifier données en cache:

Mysql

 

SELECT FORMAT (BufferPoolPages*PageSize/POWER(1024,3),2) BufferPoolDataGB FROM (SELECT variable_value BufferPoolPages FROM information_schema.global_status WHERE variable_name ='Innodb_buffer_pool_pages_data') A, (SELECT variable_value PageSize FROM information_schema.global_status WHERE variable_name ='Innodb_page_size') B;

image.png

Vérifier % d'utilisation en cache:

 

SELECT CONCAT (FORMAT (DataPages*100.0/TotalPages,2),' %') BufferPoolDataPercentage FROM (SELECT variable_value DataPages FROM information_schema.global_status WHERE variable_name ='Innodb_buffer_pool_pages_data') A, (SELECT variable_value TotalPages FROM information_schema.global_status WHERE variable_name ='Innodb_buffer_pool_pages_total') B;

image.png


Données supplémentaires sur le cache:

SHOW GLOBAL STATUS LIKE 'Innodb_buffer_pool%';

image.png

Statut Innodb:

SHOW ENGINE INNODB STATUS;

Buffer hit ratio:

SELECT round ((P2.variable_value /P1.variable_value),4),  P2.variable_value, P1.variable_value FROM information_schema.GLOBAL_STATUS P1, information_schema.GLOBAL_STATUS P2 WHERE P1. variable_name ='innodb_buffer_pool_read_requests'ANDP2. variable_name ='innodb_buffer_pool_reads'; 

image.png