MySQLÐÔÄÜÓÅ»¯µÄ²ÎÊý¼ò½é(2)
À´Ô´£ºÎ´Öª ÔðÈα༣ºÔðÈα༠·¢±íʱ¼ä:2014-05-26 11:01¡¡µã»÷:´Î
table_cache = 512
thread_cache_size = 64
query_cache_size = 64M
#Ö¸¶¨MySQL²éѯ»º³åÇøµÄ´óС¡£¿ÉÒÔͨ¹ýÔÚMySQL¿ØÖÆ̨¹Û²ì£¬Èç¹ûQcache_lowmem_prunesµÄÖµ·Ç³£´ó£¬Ôò±íÃ÷¾³£³öÏÖ»º³å²»¹»µÄÇé¿ö£»Èç¹ûQcache_hitsµÄÖµ·Ç³£´ó£¬Ôò±íÃ÷²éѯ»º³åʹÓ÷dz£Æµ·±£¬Èç¹û¸ÃÖµ½ÏС·´¶ø»áÓ°ÏìЧÂÊ£¬ÄÇô¿ÉÒÔ¿¼ÂDz»Óòéѯ»º³å£»Qcache_free_blocks£¬Èç¹û¸ÃÖµ·Ç³£´ó£¬Ôò±íÃ÷»º³åÇøÖÐËéƬºÜ¶à¡£
tmp_table_size = 256M
max_connections = 768
#Ö¸¶¨MySQLÔÊÐíµÄ×î´óÁ¬½Ó½ø³ÌÊý¡£Èç¹ûÔÚ·ÃÎÊÂÛ̳ʱ¾³£³öÏÖToo Many ConnectionsµÄ´íÎóÌá ʾ£¬ÔòÐèÒªÔö´ó¸Ã²ÎÊýÖµ¡£
max_connect_errors = 10000000
wait_timeout = 10
#Ö¸¶¨Ò»¸öÇëÇóµÄ×î´óÁ¬½Óʱ¼ä£¬¶ÔÓÚ4GB×óÓÒÄÚ´æµÄ·þÎñÆ÷¿ÉÒÔÉèÖÃΪ5-10¡£
thread_concurrency = 8
#¸Ã²ÎÊýȡֵΪ·þÎñÆ÷Âß¼CPUÊýÁ¿*2£¬ÔÚ±¾ÀýÖУ¬·þÎñÆ÷ÓÐ2¿ÅÎïÀíCPU£¬¶øÿ¿ÅÎïÀíCPUÓÖÖ§³ÖH.T³¬Ị̈߳¬ËùÒÔʵ¼ÊȡֵΪ4*2=8
skip-networking
#¿ªÆô¸ÃÑ¡Ïî¿ÉÒÔ³¹µ×¹Ø±ÕMySQLµÄTCP/IPÁ¬½Ó·½Ê½£¬Èç¹ûWEB·þÎñÆ÷ÊÇÒÔÔ¶³ÌÁ¬½ÓµÄ·½Ê½·ÃÎÊMySQLÊý¾Ý¿â·þÎñÆ÷Ôò²»Òª¿ªÆô¸ÃÑ¡Ï·ñÔò½«ÎÞ·¨Õý³£Á¬½Ó£¡
table_cache=1024
#ÎïÀíÄÚ´æÔ½´ó,ÉèÖþÍÔ½´ó.ĬÈÏΪ2402,µ÷µ½512-1024×î¼Ñ
innodb_additional_mem_pool_size=4M
#ĬÈÏΪ2M
innodb_flush_log_at_trx_commit=1
#ÉèÖÃΪ0¾ÍÊǵȵ½innodb_log_buffer_sizeÁжÓÂúºóÔÙͳһ´¢´æ,ĬÈÏΪ1
innodb_log_buffer_size=2M
#ĬÈÏΪ1M
innodb_thread_concurrency=8
#ÄãµÄ·þÎñÆ÷CPUÓм¸¸ö¾ÍÉèÖÃΪ¼¸,½¨ÒéÓÃĬÈÏÒ»°ãΪ8
key_buffer_size=256M
#ĬÈÏΪ218£¬µ÷µ½128×î¼Ñ
tmp_table_size=64M
#ĬÈÏΪ16M£¬µ÷µ½64-256×î¹Ò
read_buffer_size=4M
#ĬÈÏΪ64K
read_rnd_buffer_size=16M
#ĬÈÏΪ256K
sort_buffer_size=32M
#ĬÈÏΪ256K
thread_cache_size=120
#ĬÈÏΪ60
query_cache_size=32M
¡ùÖµµÃ×¢ÒâµÄÊÇ£º
ºÜ¶àÇé¿öÐèÒª¾ßÌåÇé¿ö¾ßÌå·ÖÎö
Ò»¡¢Èç¹ûKey_readsÌ«´ó£¬ÔòÓ¦¸Ã°Ñmy.cnfÖÐKey_buffer_size±ä´ó£¬±£³ÖKey_reads/Key_read_requestsÖÁÉÙ1/100ÒÔÉÏ£¬Ô½Ð¡Ô½ºÃ¡£
¶þ¡¢Èç¹ûQcache_lowmem_prunesºÜ´ó£¬¾ÍÒªÔö¼ÓQuery_cache_sizeµÄÖµ¡£
Õª×ÔС±¦À϶¹µÄרÀ¸
Ïà¹ØÐÂÎÅ>>
×îÐÂÍƼö¸ü¶à>>>
- ·¢±íÆÀÂÛ
-
- ×îÐÂÆÀÂÛ ¸ü¶à>>
½ñÈÕÍ·Ìõ
¸ü¶à>>Äú¿ÉÄܸÐÐËȤµÄÎÄÕÂ
ÐÂÎŵãÆÀ
ÐÂÎŹØ×¢ÅÅÐаñ
ÈÈÃÅÍƼö
×îÐÂÍƼö
1. ÓÅ»¯ÄãµÄMySQL²éѯ»º´æ ÔÚMySQL·þÎñÆ÷ÉϽøÐвéѯ£¬¿ÉÒÔÆôÓøßËÙ²éѯ»º´æ¡£ÈÃÊý¾Ý¿â[Ïêϸ]