½â¾öMysql(MyISAM)µÄ¶Áд»¥³âËøµÄÎÊÌâ
×î½üÒòΪÊý¾Ý¿â¶ÁµÄÇëÇóÔö¼Ó£¬³öÏÖÁ˱ȽÏÑÏÖصĶÁдËøÎÊÌ⣬ÓÉÓÚÖ÷´Ó·ÖÀ룬Ö÷·þÎñÆ÷ºÜ¿ìµÄÖ´ÐÐÍêÁËдÈëµÄ²Ù×÷£¬µ«´Ó¿âÓÉÓÚÓдóÁ¿µÄselectµÄ²éѯ£¬»á ±»ÕâЩÀ´×ÔÖ÷¸¨Í¬²½µÄupdate,insertÑÏÖضÂÈû£¬×îºóÔì³ÉËùÓеÄMysql´Ó¿â¸ºÔØѸËÙÉÏÉý¡£ÓÉÓÚû°ì·¨ÔÚ¶ÌÆÚÄÚÔö¼Ó¶ÁµÄ·þÎñÆ÷£¬ËùÒÔ²ÉÈ¡¶Ô Mysql½øÐÐÁËһЩÅäÖã¬ÒÔÎþÉüÊý¾ÝʵʱÐÔΪ´ú¼Û£¬À´»»È¡ËùÓзþÎñÆ÷µÄÉúÃü°²È«¡£ºÇºÇ£¬¾ßÌåÏà¹Øµ÷ÕûÒÔ¼°Ë¼Â·ÈçÏ£º
MyISAMÔÚ¶Á²Ù×÷Õ¼Ö÷µ¼µÄÇé¿öÏÂÊǺܸßЧµÄ¡£¿ÉÒ»µ©³öÏÖ´óÁ¿µÄ¶Áд²¢·¢£¬Í¬InnoDBÏà±È£¬MyISAMµÄЧÂʾͻáÖ±ÏßϽµ£¬¶øÇÒ£¬MyISAMºÍ InnoDBµÄÊý¾Ý´æ´¢·½Ê½Ò²ÓÐÏÔÖø²»Í¬£ºÍ¨³££¬ÔÚMyISAMÀÐÂÊý¾Ý»á±»¸½¼Óµ½Êý¾ÝÎļþµÄ½á⣬¿ÉÈç¹ûʱ³£×öһЩUPDATE£¬DELETE²Ù×÷Ö® ºó£¬Êý¾ÝÎļþ¾Í²»ÔÙÊÇÁ¬ÐøµÄ£¬ÐÎÏóÒ»µãÀ´Ëµ£¬¾ÍÊÇÊý¾ÝÎļþÀï³öÏÖÁ˺ܶප¶´£¬´ËʱÔÙ²åÈëÐÂÊý¾Ýʱ£¬°´È±Ê¡ÉèÖûáÏÈ¿´ÕâЩ¶´¶´µÄ´óСÊÇ·ñ¿ÉÒÔÈÝÄÉÏÂÐÂÊý¾Ý£¬ Èç¹û¿ÉÒÔ£¬ÔòÖ±½Ó°ÑÐÂÊý¾Ý±£´æµ½¶´¶´À·´Ö®£¬Ôò°ÑÐÂÊý¾Ý±£´æµ½Êý¾ÝÎļþµÄ½áβ¡£Ö®ËùÒÔÕâÑù×öÊÇΪÁ˼õÉÙÊý¾ÝÎļþµÄ´óС£¬½µµÍÎļþËéƬµÄ²úÉú¡£µ« InnoDBÀïÔò²»ÊÇÕâÑù£¬ÔÚInnoDBÀÓÉÓÚÖ÷¼üÊÇclusterµÄ£¬ËùÒÔ£¬Êý¾ÝÎļþʼÖÕÊÇ°´ÕÕÖ÷¼üÅÅÐòµÄ£¬Èç¹ûʹÓÃ×ÔÔöID×öÖ÷¼ü£¬ÔòÐÂÊý¾ÝʼÖÕ ÊÇλÓÚÊý¾ÝÎļþµÄ½áβ¡£
Á˽âÁËÕâЩ»ù´¡ÖªÊ¶£¬ÏÂÃæ˵˵MyISAM¼¸¸öÈÝÒ׺öÊÓµÄÅäÖÃÑ¡Ï
concurrent_insert£º
ͨ³£À´Ëµ£¬ÔÚMyISAMÀï¶Áд²Ù×÷ÊÇ´®Ðеģ¬µ«µ±¶Ôͬһ¸ö±í½øÐвéѯºÍ²åÈë²Ù×÷ʱ£¬ÎªÁ˽µµÍËø¾ºÕùµÄƵÂÊ£¬¸ù¾Ýconcurrent_insertµÄÉèÖã¬MyISAMÊÇ¿ÉÒÔ²¢Ðд¦Àí²éѯºÍ²åÈëµÄ£º
µ±concurrent_insert=0ʱ£¬²»ÔÊÐí²¢·¢²åÈ빦ÄÜ¡£
µ±concurrent_insert=1ʱ£¬ÔÊÐí¶ÔûÓж´¶´µÄ±íʹÓò¢·¢²åÈ룬ÐÂÊý¾ÝλÓÚÊý¾ÝÎļþ½áβ£¨È±Ê¡£©¡£
µ±concurrent_insert=2ʱ£¬²»¹Ü±íÓÐûÓж´¶´£¬¶¼ÔÊÐíÔÚÊý¾ÝÎļþ½áβ²¢·¢²åÈë¡£
ÕâÑù¿´À´£¬°Ñconcurrent_insertÉèÖÃΪ2ÊǺܻ®ËãµÄ£¬ÖÁÓÚÓɴ˲úÉúµÄÎļþËéƬ£¬¿ÉÒÔ¶¨ÆÚʹÓÃOPTIMIZE TABLEÓï·¨ÓÅ»¯¡£
max_write_lock_count£º
ȱʡÇé¿öÏ£¬Ð´²Ù×÷µÄÓÅÏȼ¶Òª¸ßÓÚ¶Á²Ù×÷µÄÓÅÏȼ¶£¬¼´±ãÊÇÏÈ·¢Ë͵ĶÁÇëÇ󣬺ó·¢Ë͵ÄдÇëÇ󣬴ËʱҲ»áÓÅÏÈ´¦ÀíдÇëÇó£¬È»ºóÔÙ´¦Àí¶ÁÇëÇó¡£Õâ¾ÍÔì³ÉÒ»¸öÎÊ Ì⣺һµ©ÎÒ·¢³öÈô¸É¸öдÇëÇ󣬾ͻá¶ÂÈûËùÓеĶÁÇëÇó£¬Ö±µ½Ð´ÇëÇóÈ«¶¼´¦ÀíÍ꣬²ÅÓлú»á´¦Àí¶ÁÇëÇó¡£´Ëʱ¿ÉÒÔ¿¼ÂÇʹÓà max_write_lock_count£º
max_write_lock_count=1
ÓÐÁËÕâÑùµÄÉèÖ㬵±ÏµÍ³´¦ÀíÒ»¸öд²Ù×÷ºó£¬¾Í»áÔÝͣд²Ù×÷£¬¸ø¶Á²Ù×÷Ö´ÐеĻú»á¡£
low-priority-updates£º
ÎÒÃÇ»¹¿ÉÒÔ¸ü¸É´àµã£¬Ö±½Ó½µµÍд²Ù×÷µÄÓÅÏȼ¶£¬¸ø¶Á²Ù×÷¸ü¸ßµÄÓÅÏȼ¶¡£
low-priority-updates=1
×ÛºÏÀ´ ¿´£¬concurrent_insert=2ÊǾø¶ÔÍƼöµÄ£¬ÖÁÓÚmax_write_lock_count=1ºÍlow-priority- updates=1£¬ÔòÊÓÇé¿ö¶ø¶¨£¬Èç¹û¿ÉÒÔ½µµÍд²Ù×÷µÄÓÅÏȼ¶£¬ÔòʹÓÃlow-priority-updates=1£¬·ñÔòʹÓà max_write_lock_count=1¡£
ÍƼöÐÅÏ¢
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- php³£ÓÃÕýÔò±í´ïʽ
- phpÐÔÄܼà²âÄ£¿éXHProf
- ÈÃCI¿ò¼ÜÖ§³Öservice²ã
- ʹÓÃPHPÉú³É´øLOGOµÄ¸öÐÔ»¯¶þάÂëͼÏñ
- ¹ØÓÚCodeIgniterÄã¿ÉÄܲ»ÖªµÀµÄ5¸ö֪ʶµã
- Memcache ºÁÃ뼶³¬Ê±¼°ÆäËû³£¼ûÎÊÌâ»ã×Ü
- [PHP±Ê¼Ç]PHPQueryÒ»¸ö´¦ÀíDOMµÄÀûÆ÷
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- PHP»ñÈ¡Óû§µÄÕæʵIP£¬²¢ÅжÏÊÇ·ñÄÚÍøIP
- PHP ´íÎóÈÕÖ¾ error_log
- ÀûÓÃbigpipe»úÖÆʵÏÖÒ³ÃæÄ£¿éµÄÒì²½äÖȾ chunked¼¼Êõ
- php¿ØÖÆÎļþÏÂÔØËÙ¶È
- js + php ¶ÁÈ¡¡¢²¥·ÅÊÓƵÁ÷ ¼æÈÝfirefox£¬c....
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- UNICODE Óë UTF-8 µÄ¹Øϵ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- phpʹÓÃmb_detect_encoding¼ì²â×Ö·û´®±àÂë
ÆÀÂÛ