MYSQL5.x 優化
另外若在連結、讀取及寫入的時間需要加長,則自行決定timeout參數的值
其他可以參考以下作法,適用x86/x64 1~2Core 4G RAM的SERVER
show VARIABLES like '%max_allowed_packet%';
set global max_allowed_packet = 1*1024*1024*1024;
show VARIABLES like '%key_buffer_size%';
set global key_buffer_size = 1*1024*1024*1024;
show VARIABLES like '%table_open_cache%';
set global table_open_cache = 1*512;
show VARIABLES like '%back_log%';
set global back_log = 1*100;
show VARIABLES like '%interactive_timeout%';
set global interactive_timeout = 1*7200;
show VARIABLES like '%read_buffer_size%';
set global read_buffer_size = 1*256*1024;
show VARIABLES like '%join_buffer_size%';
set global join_buffer_size = 1*1024*1024;
show VARIABLES like '%net_buffer_length%';
set global net_buffer_length = 1*32*1024;
show VARIABLES like '%preload_buffer_size%';
set global preload_buffer_size = 1*64*1024;
show VARIABLES like '%sort_buffer_size%';
set global sort_buffer_size = 1*512*1024;
show VARIABLES like '%thread_cache_size%';
set global thread_cache_size = 1*256;
show VARIABLES like '%table_definition_cache%';
set global table_definition_cache = 1*1000;
show VARIABLES like '%query_cache_size%';
set global query_cache_size = 1*128*1024*1204;
show VARIABLES like '%myisam_sort_buffer_size%';
set global myisam_sort_buffer_size = 1*512*1024*1024;
show VARIABLES like '%max_heap_table_size%';
set global max_heap_table_size = 1*32*1024*1024;
set global max_heap_table_size = 1*64*1024*1024;
沒有留言:
張貼留言