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