Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Each connection consumes RAM. Don't go crazy on the numbers. This nifty statement will print out the max. ammount of GB RAM the service can use with the current setting.

Code Block
use mysql;
DELIMITER //
CREATE PROCEDURE sproc_show_max_memory ( OUT max_memory DECIMAL(7,4))
BEGIN
SELECT ( @@key_buffer_size + @@query_cache_size + @@tmp_table_size + @@innodb_buffer_pool_size + @@innodb_additional_mem_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 ) ) / 1073741824 AS MAX_MEMORY_GB INTO max_memory;
END//
DELIMITER ;
CALL sproc_show_max_memory(@show_max_memory);
SELECT @show_max_memory;

 

In this example the server will not use more than 443 MB:

...