????????????????????????MySQL????????????????洢????????????????????????MySQL????????????????????????????MySQL?????????????????????????????е????????????????MySQL??????????????????????????????ЩMySQL?????????????????????????????????????ж????????ú??????????????????о????MySQL(my.cnf/my.ini)????????????????(my.cnf/my.ini)?????/????????????Mysql?????????
????linux????MySql???????
????1?????????
????MySQL????????????????????????????????????????????????Щ???????浽???????????????MySQL????????????Щ????????????????á?????????????my.cnf??
????MySQL??????????my.cnf??????????????????????/usr/local/mysql/share/mysql/???????????????? my-small.cnf??my-medium.cnf??my-large.cnf???my-huge.cnf??????????й???????????????????????????????????????磬???????MySQL????????????治??????MySQL????????????????my-small.cnf??????????????????????????mysqld daemon?????????????????????MySQL????????????????????????????????????4G???????棬??????mysql-huge.cnf ??????
??????????????????????????????????????????????????????????????????my.cnf?????????????????????????????????????????
?????????????my.cnf????????????????/etc?????????????????????????????Ч??????÷??????????е?????MySQL??????????????Ч??
??????????????my.cnf????????[MYSQL-INSTALL-DIR]/var/???????????????????????Ч??????[MYSQL-INSTALL-DIR]??????MySQL??????
??????????????????????????????÷?Χ?????????????????????my.cnf???????????????????ɡ?
????????????????my.cnf????е????????????????????Щ???????????????????????????Щ????????MySQL???????????????????????????????????MySQL?????????????????С????磬max_connections????????mysqld??????????β?????????????????????????????
????%>/usr/local/mysql/libexec/mysqld –help
?????????????????mysqld?й????????????????????Щ????????????????Щ????????“Possible variables for option –set-variable (-O) are”???????????檔?????Щ????????????????my.cnf????а??????·????????????Щ??????
???????磺
????set-variable = max_connections=1000
???????д????Ч???????????MySQL??????????????????????1000??
????2?????????
????2.1 back_log
????back_log = 500??? MySQL ???е????????????????MySQL??????????????????????????????????????????????????Щ???(??????)??????????????????????
????back_log??????MySQL???????????????????????????????????????????С????????????????????????к???????????????????????仰?????????????TCP/IP????????????е??С??????????????????д?С????????????????????趨back_log???????????????????????Ч?????????????????????б????????? 264084 | unauthenticated user | xxx.xxx.xxx.xxx | NULL | Connect | NULL | login | NULL ????????????????? back_log ??????????????50?????????????????????500??
????2.2 key_buffer_size
????Key_read_requests ????????????????????????
????Key_reads ????????????????????????
????key_buffer_size????????????????????С?????Key_reads???????e?key_buffer_size?????????????????????????(?????ж??????д)???????????????????????????????????????????е???????????????????????????滺??????С???????????????????4GB???????????ò??????????384M??512M???????????Key_read_requests?? Key_reads?????????key_buffer_size???????????????key_reads / key_read_requests??t??????????????1:100??1:1000????(??????????????SHOW STATUS LIKE ‘key_read%'???)??????ò?????????????????????????????Ч??????