Versions Compared

Key

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

...

Code Block
service mysqld reload

 

Check how much RAM the MySQL server might consume

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
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:

Code Block
+------------------+
| @show_max_memory |
+------------------+
|           0.4433 |
+------------------+

Set the same parameter on all remaining hosts

...

Code Block
for i in /etc/init.d/sq*;
do 
    serv=`basename $i`;
    if [[ "$serv" != "sqclusterd" ]]; 
    then 
        /sbin/service $serv restart;
    fi 
done