MYSQL 配置检查脚本
时间:2009-06-13 来源:火鸡
检查配置所需内存
SET @k_bytes = 1024;
SET @m_bytes = @k_bytes * 1024;
SET @g_bytes = @m_bytes * 1024;
SET @innodb_buffer_pool_size = 3 * @g_bytes;
SET @innodb_additional_mem_pool_size = 20 * @m_bytes;
SET @innodb_log_buffer_size = 20 * @m_bytes;
SET @thread_stack = 192 * @k_bytes;
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
) ) / @g_bytes AS MAX_MEMORY_USED_GB;
摘抄自 http://bbs.chinaunix.net/viewthread.php?tid=1447506&extra=&page=3
SET @k_bytes = 1024;
SET @m_bytes = @k_bytes * 1024;
SET @g_bytes = @m_bytes * 1024;
SET @innodb_buffer_pool_size = 3 * @g_bytes;
SET @innodb_additional_mem_pool_size = 20 * @m_bytes;
SET @innodb_log_buffer_size = 20 * @m_bytes;
SET @thread_stack = 192 * @k_bytes;
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
) ) / @g_bytes AS MAX_MEMORY_USED_GB;
摘抄自 http://bbs.chinaunix.net/viewthread.php?tid=1447506&extra=&page=3
相关阅读 更多 +