Memory usage snapshot

from the Artful MySQL Tips List



SELECT 
@@key_buffer_size as key_buffer, 
@@query_cache_size as query_cache, 
@@innodb_buffer_pool_size as innodb_buffer_pool, 
@@innodb_log_buffer_size as innodb_log_buffer, 
@@max_connections * ( @@read_buffer_size ) as connection,
@@read_rnd_buffer_size as read_rnd_buffer; 
SELECT
@@sort_buffer_size as sort_buffer, 
@@join_buffer_size as join_buffer, 
@@binlog_cache_size as binlog_cache, 
@@thread_stack as thread_stack, 
@@tmp_table_size as tmp_table, 
@@max_heap_table_size as max_heap_table,
least(@@tmp_table_size, @@max_heap_table_size) as tmp_tables; 

SELECT Concat( 
( @@key_buffer_size 
+ @@query_cache_size 
+ @@innodb_buffer_pool_size 
+ @@innodb_log_buffer_size 
+ @@max_connections * ( @@read_buffer_size 
+ @@read_rnd_buffer_size 
+ @@sort_buffer_size 
+ @@join_buffer_size 
+ @@binlog_cache_size 
+ @@thread_stack 
+ least(@@tmp_table_size, @@max_heap_table_size) ) 
) / (1024 * 1024 * 1024), ' GB' ) AS MYSQL_MAX_MEM; 


Return to the Artful MySQL Tips page