????2.3 max_allowed_packet
????????????????server????????????С????????SQL??????????? ?????16M????MySQL??????mysqld?????????????max_allowed_packet??????????????????“?????????”???????????????????Щ?????????????????????????в??????????????“?????MySQL????????????”????
????????????????????????????????????????????????檔???磬???????????????mysqld?????????????mysqld???????????檔?????????????С???????????????????????????????????????????????????????????????????????????????????
????2.4 table_cache
????table_cache = 512?????????????С?? ???opened_tables?????e?table_cache??????MySQL????????????????????????л??п?????????????????У?????????????????????????????????????Open_tables??Opened_tables???????????????????table_cache???????????? open_tables????table_cache??????opened_tables???????????????????????table_cache?????(??????????????SHOW STATUS LIKE ‘Open%tables'???)??????????????table_cache???ó??????????????????????????????????????????????????????????????????
????2.5 sort_buffer_size
????????????????
????sort_buffer_size = 4M???????????????????????С??????ò??????????????????????????????100??????????????????????????????С?100 × 4 = 400MB????????????????4GB??????????????????4-8M??
????2.6 read_buffer_size
????read_buffer_size = 4M????????????????????????С????sort_buffer_size??????ò??????????????????????????MySql??????????С????????????????????????????????????MySql??????????????滺??????read_buffer_size????????????????????С???????????????????????????????????????????е???????????????????????????滺??????С??????????
????2.7 join_buffer_size
????join_buffer_size = 8M?????????????????????????С????sort_buffer_size??????ò??????????????????????????
????2.8 thread_cache_size
????thread_cache_size = 64??????????????????????????????????????????????????????Threads_created????????thread_cache_size???????????????????????л??п?????????????????????????У??????????±??????????????????ж???????????????????????μ????????????????????′?????????к???μ??????????????????????????.?????? Connections ?? Threads_created ?????????????????????????????
????2.9 max_connections
????max_connections = 300???MySQL?????????????????????????????????????Too Many Connections???????????????????ò??????
????2.10 max_connect_errors
????max_connect_errors = 10000000????????????????г????ò???????????ж?????????????????????????????????????????н??????У?FLUSH HOST;??
????2.11 wait_timeout
????wait_timeout = 10???????????????????????4GB??????????????????????5-10??
????2.12 thread_concurrency
????????????????
????thread_concurrency = 8????thread_concurrency??????????? ??mysql??????????? ????cpu(????)??????£???????????thread_concurrency????? ????mysql???????????cpu(????)?? ???????????????cpu(???)????????????thread_concurrency????CPU??????2??. ?????????????CPU?? ???thread_concurrency??????4; 2??????cpu?? thread_concurrency?????8??
????2.13 tmp_table_size
???????Created_tmp_disk_tables??? ?????tmp_table_size??????????????????????????????tmp_table_size ??????С?? 32M???????????????????С??MySQL??????? The table tbl_name is full ???????????????????? GROUP BY ????????????? tmp_table_size ???
????2.14 read_rnd_buffer_size
????MySql??????????????????????????С??????????????????(???磬???????????)?????????????????????????????????????MySql???????????????壬????????????????????????????????????????????????????????MySql?????????????????????????????????????????????????濪??????
????2.15 query_cache_size????????????
?????????????????????????????????????????????????????????Щ???????????????????????????????????????????????????????????????????????????????????????????????? query_cache_size????????????SELECT?????DB?й?????DB??????仺??????????????????SQL???????DB????????DB??????????仯??????°?????????з????Client??????????????????DB??????Query_cache???????????????漰???????????????з???????????????????????????Query_cache??????????????????????????Query_cache??????????????????Ч???????д????????????Query_cache?????????????????????????Ч???????????????Insert???????????????????Update????Insert??????????????????????д????????????????????????ò??????????????????????????д????????????????ù???????