• 2020ÔĶÁ
  • 2»Ø¸´

MySQLÕ¼ÓÃCPU¹ý¸ßÈçºÎÓÅ»¯?Ö´ÐÐ top ÃüÁî

Â¥²ãÖ±´ï
MySQLÕ¼ÓÃCPU¹ý¸ßÈçºÎÓÅ»¯ 'gf[Wjb,%  
t.( `$  
Ò»´ÎÉú²úDB·þÎñÆ÷µÄ ³¬¸ººÉÔËÐÐÎÊÌâ½â¾ö£º T~E;@weR  
1.²é¿´Éú²úDB·þÎñÆ÷topÁÐ±í£¬ >?@5>wF  
Ö´ÐÐ top ÃüÁî aGbG@c8PRi  
²é¿´Cpu(s) ²ÎÊýÒ»Ö±´¦ÓÚ 98% ״̬ £¬load average´ïµ½ÁË 5  (4ºË·þÎñÆ÷) uMQI Aapb  
(%B{=w}8  
¿É¼ûDBÒѾ­³¬¸ººÉÔËÐÐÁË yI^Yh{  
uz!8=,DFw  
2.ʹÓÃrootÓû§µÇ¼mysql __ g?xw  
Ö´ÐÐ show full processlist  ²é¿´Âý²éѯ£¬·´¸´Ö´ÐУ¬·¢ÏÖÒ»Ö±ÓÐ3¸öselect ²éѯÓï¾ä´æÔÚ£¬ÎªÁË»º½âDB·þÎñÆ÷ѹÁ¦£¬Ö±½ÓʹÓÃkillÃüÁîɱµô t<v.rb  
kill  Âý²éѯµÄid hQ|mow@Zmz  
·þÎñÆ÷ѹÁ¦»º½â£¬»Ö¸´Õý³£¡£ eke[{%L  
ʹÓÃÕâÌõSQLÓï¾äÈ¥ÏîÄ¿ÖÐÕÒµ½¶ÔÓ¦¹¦ÄÜ£¬¾­²éÊÇûÓõŦÄÜ£¬Ö±½ÓÒþ²ØÕâ¸ö¹¦ÄÜ£¬ÎÊÌâ½â¾ö¡£ 3= =["hO  
) h]+cGM  
0T`Qoo>u  
+v B}E  
MysqlÕ¼ÓÃCPU¹ý¸ßÈçºÎÓÅ»¯£¿ *F( qg%1+  
J&aN6l?  
MySQL´¦Ôڸ߸ºÔØ»·¾³Ï£¬´ÅÅÌIO¶Áд¹ý¶à£¬¿Ï¶¨»áÕ¼Óúܶà×ÊÔ´£¬±ØÈ»CP»áUÕ¼Óùý¸ß¡£ *O$|,EsY  
Õ¼ÓÃCPU¹ý¸ß£¬¿ÉÒÔ×öÈçÏ¿¼ÂÇ£º Nw. )O  
1.´ò¿ªÂý²éѯÈÕÖ¾£¬²éѯÊÇ·ñÊÇij¸öSQLÓï¾äÕ¼Óùý¶à×ÊÔ´£¬Èç¹ûÊǵĻ°£¬¿ÉÒÔ¶ÔSQLÓï¾ä½øÐÐÓÅ»¯£¬±ÈÈçÓÅ»¯ insert Óï¾ä¡¢ÓÅ»¯ group by Óï¾ä¡¢ÓÅ»¯ order by Óï¾ä¡¢ÓÅ»¯ join Óï¾äµÈµÈ£» YhH3fVM  
2.¿¼ÂÇË÷ÒýÎÊÌ⣻ G u`xJ  
3.¶¨ÆÚ·ÖÎö±í£¬Ê¹ÓÃoptimize table£» 4XAB_Q  
4.ÓÅ»¯Êý¾Ý¿â¶ÔÏó£» ajycYk9<m  
5.¿¼ÂÇÊÇ·ñÊÇËøÎÊÌ⣻ 3Ws(],Q  
6.µ÷ÕûһЩMySQL Server²ÎÊý£¬±ÈÈçkey_buffer_size¡¢table_cache¡¢innodb_buffer_pool_size¡¢innodb_log_file_sizeµÈµÈ£» (A?>U_@  
7.Èç¹ûÊý¾ÝÁ¿¹ý´ó£¬¿ÉÒÔ¿¼ÂÇʹÓÃMySQL¼¯Èº»òÕߴ¸ß¿ÉÓû·¾³¡£ gxO~44"  
7u"Q1n(h/  
mysql show processlist + show status + kill IdÃüÁîÏê½â  GAfc9  
807+|Ol[  
1. SHOW PROCESSLIST cWQJ9.:7  
ÏÔʾÄÄЩÏß³ÌÕýÔÚÔËÐС£ÄúÒ²¿ÉÒÔʹÓÃmysqladmin processlistÓï¾äµÃµ½´ËÐÅÏ¢¡£Èç¹ûÄúÓÐSUPERȨÏÞ£¬Äú¿ÉÒÔ¿´µ½ËùÓÐÏ̡߳£·ñÔò£¬ÄúÖ»ÄÜ¿´µ½Äú×Ô¼ºµÄỊ̈߳¨Ò²¾ÍÊÇ£¬ÓëÄúÕýÔÚʹÓõÄMySQL ÕË»§Ïà¹ØµÄỊ̈߳©¡£Çë²Î¼û13.5.5.3½Ú£¬¡°KILLÓï·¨¡±¡£Èç¹ûÄú²»Ê¹ÓÃFULL¹Ø¼ü´Ê£¬ÔòÖ»ÏÔʾÿ¸ö²éѯµÄÇ°100¸ö×Ö·û¡£ _gVihu  
KOg,V_(I  
±¾Óï¾ä±¨¸æTCP/IPÁ¬½ÓµÄÖ÷»úÃû³Æ£¨²ÉÓÃhost_name:client_port¸ñʽ£©£¬ÒÔ·½±ãµØÅж¨Äĸö¿Í»§¶ËÕýÔÚ×öʲô¡£ ! #Pn_e  
f8-`bb  
Èç¹ûÄúµÃµ½¡°too many connections¡±´íÎóÐÅÏ¢£¬²¢ÇÒÏëÒªÁ˽âÕýÔÚ·¢ÉúµÄÇé¿ö£¬±¾Óï¾äÊǷdz£ÓÐÓõġ£MySQL±£ÁôÒ»¸ö¶îÍâµÄÁ¬½Ó£¬ÈÃÓµÓÐSUPERȨÏÞµÄ ÕË»§Ê¹Óã¬ÒÔÈ·±£¹ÜÀíÔ±Äܹ»ËæʱÁ¬½ÓºÍ¼ì²éϵͳ£¨¼ÙÉèÄúûÓаѴËȨÏÞ¸øÓèËùÓеÄÓû§£©¡£ \L>XF'o  
-|'@ :cIZ  
Õâ¸öÃüÁîÖÐ×î¹Ø¼üµÄ¾ÍÊÇstateÁУ¬mysqlÁгöµÄ״̬Ö÷ÒªÓÐÒÔϼ¸ÖÖ£º MZ%J ]Nd  
qVU<jt  
Checking table 9z4F/tUq  
¡¡ÕýÔÚ¼ì²éÊý¾Ý±í£¨ÕâÊÇ×Ô¶¯µÄ£©¡£ -)%\$z  
Closing tables DvhF CA}z  
¡¡ÕýÔÚ½«±íÖÐÐ޸ĵÄÊý¾Ýˢе½´ÅÅÌÖУ¬Í¬Ê±ÕýÔڹرÕÒѾ­ÓÃÍêµÄ±í¡£ÕâÊÇÒ»¸öºÜ¿ìµÄ²Ù×÷£¬Èç¹û²»ÊÇÕâÑùµÄ»°£¬¾ÍÓ¦¸ÃÈ·ÈÏ´ÅÅÌ¿Õ¼äÊÇ·ñÒѾ­ÂúÁË»òÕß´ÅÅÌÊÇ·ñÕý´¦ÓÚÖظºÖС£ &DGqY5=  
Connect Out yPfx!9B  
¡¡¸´ÖÆ´Ó·þÎñÆ÷ÕýÔÚÁ¬½ÓÖ÷·þÎñÆ÷¡£ <nJGJ5JJ  
Copying to tmp table on disk =0&XdxX  
¡¡ÓÉÓÚÁÙʱ½á¹û¼¯´óÓÚtmp_table_size£¬ÕýÔÚ½«ÁÙʱ±í´ÓÄÚ´æ´æ´¢×ªÎª´ÅÅÌ´æ´¢ÒԴ˽ÚÊ¡ÄÚ´æ¡£ |j"C52Q  
Creating tmp table ]pNM~,  
¡¡ÕýÔÚ´´½¨ÁÙʱ±íÒÔ´æ·Å²¿·Ö²éѯ½á¹û¡£ &H+ wzx<  
deleting from main table .\H-?6R^  
¡¡·þÎñÆ÷ÕýÔÚÖ´Ðжà±íɾ³ýÖеĵÚÒ»²¿·Ö£¬¸Õɾ³ýµÚÒ»¸ö±í¡£ /E/6(c  
deleting from reference tables 0F uj-q  
¡¡·þÎñÆ÷ÕýÔÚÖ´Ðжà±íɾ³ýÖеĵڶþ²¿·Ö£¬ÕýÔÚɾ³ýÆäËû±íµÄ¼Ç¼¡£ j^/<:e c.  
Flushing tables ^Zpz@T>m  
¡¡ÕýÔÚÖ´ÐÐFLUSH TABLES£¬µÈ´ýÆäËûÏ̹߳رÕÊý¾Ý±í¡£ %Lx#7bR U  
Killed CWZv/>,%  
¡¡·¢ËÍÁËÒ»¸ökillÇëÇó¸øijỊ̈߳¬ÄÇôÕâ¸öÏ߳̽«»á¼ì²ékill±ê־λ£¬Í¬Ê±»á·ÅÆúÏÂÒ»¸ökillÇëÇó¡£MySQL»áÔÚÿ´ÎµÄÖ÷Ñ­»·Öмì²é kill±ê־룬²»¹ýÓÐЩÇé¿öϸÃÏ߳̿ÉÄÜ»á¹ýһС¶Î²ÅÄÜËÀµô¡£Èç¹û¸ÃÏ̳̱߳»ÆäËûÏß³ÌËøסÁË£¬ÄÇôkillÇëÇó»áÔÚËøÊÍ·ÅʱÂíÉÏÉúЧ¡£ ZLaht(`+  
Locked "pX|?ap  
¡¡±»ÆäËû²éѯËøסÁË¡£ W;Dik%^tg  
Sending data |@rf#,hTDp  
¡¡ÕýÔÚ´¦ÀíSELECT²éѯµÄ¼Ç¼£¬Í¬Ê±ÕýÔڰѽá¹û·¢Ë͸ø¿Í»§¶Ë¡£ z xgDaT  
Sorting for group Lz9|"F"V  
¡¡ÕýÔÚΪGROUP BY×öÅÅÐò¡£ Mj0jpP<uf  
¡¡Sorting for order *` -  
¡¡ÕýÔÚΪORDER BY×öÅÅÐò¡£ aEUEy:.  
Opening tables iMYJVB=  
¡¡Õâ¸ö¹ý³ÌÓ¦¸Ã»áºÜ¿ì£¬³ý·ÇÊܵ½ÆäËûÒòËصĸÉÈÅ¡£ÀýÈ磬ÔÚÖ´ALTER TABLE»òLOCK TABLEÓï¾äÐÐÍêÒÔÇ°£¬Êý¾Ý±íÎÞ·¨±»ÆäËûÏ̴߳ò¿ª¡£Õý³¢ÊÔ´ò¿ªÒ»¸ö±í¡£ c#9=o;1El  
Removing duplicates f#38QP-T  
¡¡ÕýÔÚÖ´ÐÐÒ»¸öSELECT DISTINCT·½Ê½µÄ²éѯ£¬µ«ÊÇMySQLÎÞ·¨ÔÚÇ°Ò»¸ö½×¶ÎÓÅ»¯µôÄÇЩÖظ´µÄ¼Ç¼¡£Òò´Ë£¬MySQLÐèÒªÔÙ´ÎÈ¥µôÖظ´µÄ¼Ç¼£¬È»ºóÔٰѽá¹û·¢Ë͸ø¿Í»§¶Ë¡£ _B&;z $  
Reopen table EwfL.z  
¡¡»ñµÃÁ˶ÔÒ»¸ö±íµÄËø£¬µ«ÊDZØÐëÔÚ±í½á¹¹ÐÞ¸ÄÖ®ºó²ÅÄÜ»ñµÃÕâ¸öËø¡£ÒѾ­ÊÍ·ÅËø£¬¹Ø±ÕÊý¾Ý±í£¬Õý³¢ÊÔÖØдò¿ªÊý¾Ý±í¡£ 0CeBU(U+|R  
Repair by sorting 9D5v0Qi  
¡¡ÐÞ¸´Ö¸ÁîÕýÔÚÅÅÐòÒÔ´´½¨Ë÷Òý¡£ rb.:(d)T  
Repair with keycache VyIM ,glu  
¡¡ÐÞ¸´Ö¸ÁîÕýÔÚÀûÓÃË÷Òý»º´æÒ»¸öÒ»¸öµØ´´½¨ÐÂË÷Òý¡£Ëü»á±ÈRepair by sortingÂýЩ¡£ WD8F]+2O\  
Searching rows for update FYaBP;@J%  
¡¡ÕýÔÚ½²·ûºÏÌõ¼þµÄ¼Ç¼ÕÒ³öÀ´ÒÔ±¸¸üС£Ëü±ØÐëÔÚUPDATEÒªÐÞ¸ÄÏà¹ØµÄ¼Ç¼֮ǰ¾ÍÍê³ÉÁË¡£ 2ak*aI  
Sleeping  *% ]&5  
¡¡ÕýÔڵȴý¿Í»§¶Ë·¢ËÍÐÂÇëÇó. =, U~  
System lock  N,ihQB5  
¡¡ÕýÔڵȴýÈ¡µÃÒ»¸öÍⲿµÄϵͳËø¡£Èç¹ûµ±Ç°Ã»ÓÐÔËÐжà¸ömysqld·þÎñÆ÷ͬʱÇëÇóͬһ¸ö±í£¬ÄÇô¿ÉÒÔͨ¹ýÔö¼Ó--skip-external-locking²ÎÊýÀ´½ûÖ¹ÍⲿϵͳËø¡£ Gd2t^tc  
Upgrading lock bmRp)CYd  
¡¡INSERT DELAYEDÕýÔÚ³¢ÊÔÈ¡µÃÒ»¸öËø±íÒÔ²åÈëмǼ¡£ > 8!9  
Updating dEoW8 M#  
¡¡ÕýÔÚËÑË÷Æ¥ÅäµÄ¼Ç¼£¬²¢ÇÒÐÞ¸ÄËüÃÇ¡£ |HTTTz9R.  
User Lock QL@}hw.F  
¡¡ÕýÔڵȴýGET_LOCK()¡£ $gcC}tX  
Waiting for tables Z=144n 1  
¡¡¸ÃÏ̵߳õ½Í¨Öª£¬Êý¾Ý±í½á¹¹ÒѾ­±»ÐÞ¸ÄÁË£¬ÐèÒªÖØдò¿ªÊý¾Ý±íÒÔÈ¡µÃеĽṹ¡£È»ºó£¬ÎªÁËÄܵÄÖØдò¿ªÊý¾Ý±í£¬±ØÐëµÈµ½ËùÓÐÆäËûÏ̹߳رÕÕâ¸ö ±í¡£ÒÔϼ¸ÖÖÇé¿öÏ»á²úÉúÕâ¸ö֪ͨ£ºFLUSH TABLES tbl_name, ALTER TABLE, RENAME TABLE, REPAIR TABLE, ANALYZE TABLE,»òOPTIMIZE TABLE¡£ X./7b{Pax  
waiting for handler insert /80RO:'7  
¡¡INSERT DELAYEDÒѾ­´¦ÀíÍêÁËËùÓдý´¦ÀíµÄ²åÈë²Ù×÷£¬ÕýÔڵȴýеÄÇëÇó¡£ c ^+{YH;k  
¡¡´ó²¿·Ö״̬¶ÔÓ¦ºÜ¿ìµÄ²Ù×÷£¬Ö»ÒªÓÐÒ»¸öÏ̱߳£³Öͬһ¸ö״̬ºÃ¼¸ÃëÖÓ£¬ÄÇô¿ÉÄÜÊÇÓÐÎÊÌâ·¢ÉúÁË£¬ÐèÒª¼ì²éһϡ£ &_<!zJ;Hn  
¡¡»¹ÓÐÆäËûµÄ״̬ûÔÚÉÏÃæÖÐÁгöÀ´£¬²»¹ýËüÃǴ󲿷ÖÖ»ÊÇÔڲ鿴·þÎñÆ÷ÊÇ·ñÓдæÔÚ´íÎóÊDzÅÓõÃ×Å¡£ m^YYdyn]M  
|D[4 G6&  
mysql ²é¿´µ±Ç°Á¬½ÓÊý ;fKFmY41  
4wx _@8  
ÃüÁ show processlist; <.c#l':  
Èç¹ûÊÇrootÕʺţ¬ÄãÄÜ¿´µ½ËùÓÐÓû§µÄµ±Ç°Á¬½Ó¡£Èç¹ûÊÇÆäËüÆÕͨÕʺţ¬Ö»ÄÜ¿´µ½×Ô¼ºÕ¼ÓõÄÁ¬½Ó¡£ `Ct fe8  
show processlist;Ö»ÁгöÇ°100Ìõ£¬Èç¹ûÏëÈ«ÁгöÇëʹÓÃshow full processlist; ^yVKW5x  
mysql> show processlist; `RL n)a  
Ö»¿´¸Ã×÷Õß °²ÒÝɳ·¢  ·¢±íÓÚ: 2017-02-25
2. show status 1e }wDMU(  
]g:VvTJ;?  
Aborted_clients ÓÉÓÚ¿Í»§Ã»ÓÐÕýÈ·¹Ø±ÕÁ¬½ÓÒѾ­ËÀµô£¬ÒѾ­·ÅÆúµÄÁ¬½ÓÊýÁ¿¡£ _Ab|<!a/R  
Aborted_connects ³¢ÊÔÒѾ­Ê§°ÜµÄMySQL·þÎñÆ÷µÄÁ¬½ÓµÄ´ÎÊý¡£ :}Z+K*%o-  
Connections ÊÔͼÁ¬½ÓMySQL·þÎñÆ÷µÄ´ÎÊý¡£ 8NpQ"0X  
Created_tmp_tables µ±Ö´ÐÐÓï¾äʱ£¬ÒѾ­±»´´ÔìÁ˵ÄÒþº¬ÁÙʱ±íµÄÊýÁ¿¡£ *C$ W^u5h  
Delayed_insert_threads ÕýÔÚʹÓõÄÑÓ³Ù²åÈë´¦ÀíÆ÷Ï̵߳ÄÊýÁ¿¡£ 9'}m797I'  
Delayed_writes ÓÃINSERT DELAYEDдÈëµÄÐÐÊý¡£ y6$5meh.T  
Delayed_errors ÓÃINSERT DELAYEDдÈëµÄ·¢ÉúijЩ´íÎó(¿ÉÄÜÖظ´¼üÖµ)µÄÐÐÊý¡£ [N{Rd[{QTL  
Flush_commands Ö´ÐÐFLUSHÃüÁîµÄ´ÎÊý¡£ kYx|`-PA<r  
Handler_delete ÇëÇó´ÓÒ»ÕűíÖÐɾ³ýÐеĴÎÊý¡£ euQ d  
Handler_read_first ÇëÇó¶ÁÈë±íÖеÚÒ»ÐеĴÎÊý¡£ !uHX2B+~  
Handler_read_key ÇëÇóÊý×Ö»ùÓÚ¼ü¶ÁÐС£ QH;1*  
Handler_read_next ÇëÇó¶ÁÈë»ùÓÚÒ»¸ö¼üµÄÒ»ÐеĴÎÊý¡£ [5>0om5  
Handler_read_rnd ÇëÇó¶ÁÈë»ùÓÚÒ»¸ö¹Ì¶¨Î»ÖõÄÒ»ÐеĴÎÊý¡£ nXXyX[c4e  
Handler_update ÇëÇó¸üбíÖÐÒ»ÐеĴÎÊý¡£ \=1k29O  
Handler_write ÇëÇóÏò±íÖвåÈëÒ»ÐеĴÎÊý¡£ #VtlXr>G  
Key_blocks_used ÓÃÓڹؼü×Ö»º´æµÄ¿éµÄÊýÁ¿¡£  R:-^,/1  
Key_read_requests ÇëÇó´Ó»º´æ¶ÁÈëÒ»¸ö¼üÖµµÄ´ÎÊý¡£ D}Z].c@ E  
Key_reads ´Ó´ÅÅÌÎïÀí¶ÁÈëÒ»¸ö¼üÖµµÄ´ÎÊý¡£ UfXqcyY(  
Key_write_requests ÇëÇó½«Ò»¸ö¹Ø¼ü×Ö¿éдÈ뻺´æ´ÎÊý¡£ g?)9zJ9  
Key_writes ½«Ò»¸ö¼üÖµ¿éÎïÀíдÈë´ÅÅ̵ĴÎÊý¡£ c1Xt$[_  
Max_used_connections ͬʱʹÓõÄÁ¬½ÓµÄ×î´óÊýÄ¿¡£ 5_#wOz0u$  
Not_flushed_key_blocks ÔÚ¼ü»º´æÖÐÒѾ­¸Ä±äµ«ÊÇ»¹Ã»±»Çå¿Õµ½´ÅÅÌÉϵļü¿é¡£ l\JoWL  
Not_flushed_delayed_rows ÔÚINSERT DELAY¶ÓÁÐÖеȴýдÈëµÄÐеÄÊýÁ¿¡£ u+kXJ  
Open_tables ´ò¿ª±íµÄÊýÁ¿¡£ O$<kWSC  
Open_files ´ò¿ªÎļþµÄÊýÁ¿¡£ vA*!82  
Open_streams ´ò¿ªÁ÷µÄÊýÁ¿(Ö÷ÒªÓÃÓÚÈÕÖ¾¼ÇÔØ£© ,_D`0B6o  
Opened_tables ÒѾ­´ò¿ªµÄ±íµÄÊýÁ¿¡£ n'K,*  
Questions ·¢Íù·þÎñÆ÷µÄ²éѯµÄÊýÁ¿¡£ \IQf|  
Slow_queries Òª»¨³¬¹ýlong_query_timeʱ¼äµÄ²éѯÊýÁ¿¡£ +' QX`  
Threads_connected µ±Ç°´ò¿ªµÄÁ¬½ÓµÄÊýÁ¿¡£ /z.Y<xOc  
Threads_running ²»ÔÚ˯ÃßµÄÏß³ÌÊýÁ¿¡£ 5(]=?$$*t  
Uptime ·þÎñÆ÷¹¤×÷Á˶àÉÙÃë¡£ nn5tOV}QE  
_8v8qT}O~4  
After create IQAV`~_G  
4"nb>tA  
This occurs when the thread creates a table (including internal temporary tables), at the end of the function that creates the table. This state is used even if the table could not be created due to some error. )v !GiZ" 7  
MqDz cB]  
Analyzing 0JN>w^  
R*|y:T,H  
The thread is calculating a MyISAM table key distributions (for example, for ANALYZE TABLE). [H<![Z1*r  
bFD vCF  
checking permissions Wn6~x2LaV  
094~  s  
The thread is checking whether the server has the required privileges to execute the statement. iI\ bD  
wFI2 (cQ  
Checking table s\O4D*8  
ldk (zAB.  
The thread is performing a table check operation. B?n 6o|8  
@D1}).  
cleaning up %EV\nwn6  
oHh~!#u  
The thread has processed one command and is preparing to free memory and reset certain state variables. {&7%wZ"t_  
KTLq~Ru  
closing tables \"k[y+O],4  
v<0\+}T1R  
The thread is flushing the changed table data to disk and closing the used tables. This should be a fast operation. If not, you should verify that you do not have a full disk and that the disk is not in very heavy use. 4gD;XNrV  
E3hql3=  
converting HEAP to MyISAM [Ey[A|g  
: ;l9to  
The thread is converting an internal temporary table from a MEMORY table to an on-disk MyISAM table. ~V34j:  
@~p;.=1]F  
copy to tmp table g}@W9'!  
bqPaXH n  
The thread is processing an ALTER TABLE statement. This state occurs after the table with the new structure has been created but before rows are copied into it. fI<|]c}P&J  
"%zb>`1s  
Copying to group table };{Qx  
 eeMeV>  
If a statement has different ORDER BY and GROUP BY criteria, the rows are sorted by group and copied to a temporary table. TKH!,Ow9A  
Nh^ lC  
Copying to tmp table [[XbKg`"?  
pLdZB9oD]C  
The server is copying to a temporary table in memory. aw\0\'}  
cM?i _m  
Copying to tmp table on disk / biB *Z  
?y/LMja  
The server is copying to a temporary table on disk. The temporary result set was larger than tmp_table_size and the thread is changing the temporary table from in-memory to disk-based format to save memory.  j1~'[  
b'O>qQ  
Creating index sx^0*h-Qq  
dbsD\\,2%N  
The thread is processing ALTER TABLE ... ENABLE KEYS for a MyISAM table. ."u DM<  
o4t6NDa  
Creating sort index ^[g7B"`K5  
HU1ZQkf  
The thread is processing a SELECT that is resolved using an internal temporary table. A(@VjXl  
($T"m-e  
creating table MhL>6rn  
eqQ=HT7J  
The thread is creating a table. This includes creation of temporary tables. Qq{>]5<  
GwM(E^AG  
Creating tmp table 7^FJ+gN8b  
Ad)::9K?J  
The thread is creating a temporary table in memory or on disk. If the table is created in memory but later is converted to an on-disk table, the state during that operation will be Copying to tmp table on disk. Wi2Tg^  
=im7RgIBo  
deleting from main table :cA%lKg  
~\khwNA  
The server is executing the first part of a multiple-table delete. It is deleting only from the first table, and saving columns and offsets to be used for deleting from the other (reference) tables. UAEu.AT  
d1BE;9*/7  
deleting from reference tables "pMx(  
QzilivJf  
The server is executing the second part of a multiple-table delete and deleting the matched rows from the other tables. /Bs42uJ3  
[]l2 `fS#  
discard_or_import_tablespace =;(y5c  
>_|$7m.?n[  
The thread is processing an ALTER TABLE ... DISCARD TABLEspaCE or ALTER TABLE ... IMPORT TABLEspaCE statement. ?aWMU?S  
gGE&}EoLU  
end 5j~1%~,#  
H;c3 x"  
This occurs at the end but before the cleanup of ALTER TABLE, CREATE VIEW, DELETE, INSERT, SELECT, or UPDATE statements. EECuJ+T  
9A,ok[J  
executing -gB9476-  
m[DCA\M o@  
The thread has begun executing a statement. R3|r` ~@@  
|*( R$tX  
Execution of init_command H b?0?^#  
UvF5u(o  
The thread is executing statements in the value of the init_command system variable. }fJLY\  
txik{' :  
freeing items 722:2 {  
<DZ$"t  
The thread has executed a command. This state is usually followed by cleaning up. k}] M`ad  
<,*3Av  
Flushing tables UDW_?SHAx  
0.[tEnLZ  
The thread is executing FLUSH TABLES and is waiting for all threads to close their tables. MdDL?ev  
|:]} u|O  
FULLTEXT initialization &dG^M2g-F  
 &2bqL!k  
The server is preparing to perform a natural-language full-text search. saTS8p z  
2ck0k,WP  
init !/e*v>3u&  
nS](d2  
This occurs before the initialization of ALTER TABLE, DELETE, INSERT, SELECT, or UPDATE statements. @H8DGeM  
6AdC  
Killed ]iMqIh"  
adPd}rt;  
Someone has sent a KILL statement to the thread and it should abort next time it checks the kill flag. The flag is checked in each major loop in MySQL, but in some cases it might still take a short time for the thread to die. If the thread is locked by some other thread, the kill takes effect as soon as the other thread releases its lock. zdm2`D;~p  
_+.JTk  
Locked CeeAw_*@  
"8R &c}  
The query is locked by another query. 4xH/a1&p=  
Sy' ]fGvx  
logging slow query S9{A}+"K  
3YJ"[$w='(  
The thread is writing a statement to the slow-query log. '4SDAa2f  
)*`h)`\y  
NULL fY6~Z BvK  
Z #T  
This state is used for the SHOW PROCESSLIST state. 2WTOu x*  
tt#dO@G#Fe  
login s<rV1D  
uovv">Uw  
The initial state for a connection thread until the client has been authenticated successfully. Nk<^ Qv  
[F'|KcE3  
Opening tables, Opening table bK.*v4RG  
loO"[8i.k  
The thread is trying to open a table. This is should be very fast procedure, unless something prevents opening. For example, an ALTER TABLE or a LOCK TABLE statement can prevent opening a table until the statement is finished. Z %Ozzp/  
#f YB4.i~  
preparing o8Gygi5  
993f6  
This state occurs during query optimization. FY ms]bv  
s2#Ia>5!  
Purging old relay logs  m1U:&{:^  
_$ivN!k  
The thread is removing unneeded relay log files. fEX=csZ86  
)@X0'X<  
query end vWZXb `  
>m>F {v  
This state occurs after processing a query but before the freeing items state. -}9^$}PR  
I5_HaC>  
Reading from net Z*i p=FYR  
80Dn!9j*  
The server is reading a packet from the network. b,E?{uG  
4"|Xndh1.  
Removing duplicates 3R3H+W0{  
('tXv"fT  
The query was using SELECT DISTINCT in such a way that MySQL could not optimize away the distinct operation at an early stage. Because of this, MySQL requires an extra stage to remove all duplicated rows before sending the result to the client. 4,e'B-.  
<w{?b'/q  
removing tmp table dRX~eIw  
9{*{Ba  
The thread is removing an internal temporary table after processing a SELECT statement. This state is not used if no temporary table was created. mb1mlsE  
r3l1I}  
rename z uV%`n  
)l7XZ_gw'  
The thread is renaming a table. >fH0>W+!  
]JrD@ Vy  
rename result table ; oyV8P$  
%MeAa?G-#  
The thread is processing an ALTER TABLE statement, has created the new table, and is renaming it to replace the original table. BNfj0e5b  
yQ$irS?  
Reopen tables ye^x>a['  
,/\`Rc^n  
The thread got a lock for the table, but noticed after getting the lock that the underlying table structure changed. It has freed the lock, closed the table, and is trying to reopen it. ?zW'Hi  
V<QpC5  
Repair by sorting qyz%9 9  
6}^x#9\  
The repair code is using a sort to create indexes. <= 4$.2ym  
4uXGp sL  
Repair done &FXf]9 _X  
)Te\6qM  
The thread has completed a multi-threaded repair for a MyISAM table. `% 9Y)a/e  
ynsYU(  
Repair with keycache .I`>F/Sjr  
/TMVPnvz.  
The repair code is using creating keys one by one through the key cache. This is much slower than Repair by sorting. v;(cJ,l  
{"p ~M7  
Rolling back $bE" 3/uf  
y" =?l  
The thread is rolling back a transaction. JI@iT6.%IX  
+3))G  
Saving state D[>:az `  
=c6d $  
For MyISAM table operations such as repair or analysis, the thread is saving the new table state to the .MYI file header. State includes information such as number of rows, the AUTO_INCREMENT counter, and key distributions. rCo}^M4Pb  
[vr"FLM|9  
Searching rows for update #'/rFT4{v  
gbdzS6XW~  
The thread is doing a first phase to find all matching rows before updating them. This has to be done if the UPDATE is changing the index that is used to find the involved rows. 9"[,9HN  
%RW*gUvc]  
Sending data CV[9i  
X}GX6qAdt  
The thread is processing rows for a SELECT statement and also is sending data to the client. |K. I%B  
3XY"s"  
setup @Ov}X]ELi  
hrX/,D -c  
The thread is beginning an ALTER TABLE operation. !}} )f/  
jct=Nee|  
Sorting for group  qbc=kP  
hc W>R  
The thread is doing a sort to satisfy a GROUP BY. ~"*W;|)  
+6:  
Sorting for order D_( NLC  
}x|q*E\  
The thread is doing a sort to satisfy a ORDER BY. 0OlT^  
;P' 5RCqj  
Sorting index bR}fj.gP  
M]%dFQ  
The thread is sorting index pages for more efficient access during a MyISAM table optimization operation. Ze/\IBd  
W$7H "tg  
Sorting result IPn!iv)  
"([gN:   
For a SELECT statement, this is similar to Creating sort index, but for nontemporary tables. Q e/XEW  
`'3&tAy  
statistics "3++S  
n5oX51J  
The server is calculating statistics to develop a query execution plan. #%%!r$UL  
}l}_'FmQ  
System lock 0$b4\.0>~  
d"E3ypPK  
The thread is going to request or is waiting for an internal or external system lock for the table. If this state is being caused by requests for external locks and you are not using multiple mysqld servers that are accessing the same tables, you can disable external system locks with the --skip-external-locking option. However, external locking is disabled by default, so it is likely that this option will have no effect. For SHOW PROFILE, this state means the thread is requesting the lock (not waiting for it). pyX:$j2R+%  
EUh_`R  
Table lock ;"#yHP`  
vgDpo@fz8  
The next thread state after System lock. The thread has acquired an external lock and is going to request an internal table lock. /kw;q{>?o  
}/\`'LQ  
Updating Zl'/Mx g  
?7lW@U0  
The thread is searching for rows to update and is updating them. \Wg_ gA  
4M]l~9;A  
updating main table u>vvW|OB[  
K0B<9Wi |  
The server is executing the first part of a multiple-table update. It is updating only the first table, and saving columns and offsets to be used for updating the other (reference) tables. O^6anUV0  
|N)),/R_  
updating reference tables ^A=tk!C  
Zo^]y'  
The server is executing the second part of a multiple-table update and updating the matched rows from the other tables. D:IG;Rsc  
'|yCDBu  
User lock  \G)F*  
|6^%_kO!|  
The thread is going to request or is waiting for an advisory lock requested with a GET_LOCK() call. For SHOW PROFILE, this state means the thread is requesting the lock (not waiting for it). gX-hYQrC  
|#SZd Xg  
Waiting for tables, Waiting for table ZMiOKVl  
liLhvcd  
The thread got a notification that the underlying structure for a table has changed and it needs to reopen the table to get the new structure. However, to reopen the table, it must wait until all other threads have closed the table in question. z5~W >r  
N]| >\  
This notification takes place if another thread has used FLUSH TABLES or one of the following statements on the table in question: FLUSH TABLES tbl_name, ALTER TABLE, RENAME TABLE, REPAIR TABLE, ANALYZE TABLE, or OPTIMIZE TABLE. H=f| X<8  
dkCU U  
Waiting on cond SZ$WC8AX  
,5ZQPICF  
A generic state in which the thread is waiting for a condition to become true. No specific state information is available. r;[=y<Yf  
C&*1H`n  
Writing to net 2=0HQXXrq  
S1mMz i  
The server is writing a packet to the network. Pgy[\t2K  
3. kill mysql Ö´ÐÐÏß³Ì qz (x  
(1) show processlist;
¿ìËٻظ´

ÏÞ100 ×Ö½Ú
°²ÒÝÍøÌáʾ:Èç¹ûÄúÌá½»¹ýÒ»´Îʧ°ÜÁË£¬¿ÉÒÔÓá±»Ö¸´Êý¾Ý¡±À´»Ö¸´Ìû×ÓÄÚÈÝ
 
ÈÏÖ¤Âë:
ÉÏÒ»¸ö ÏÂÒ»¸ö