記 一條由SELECT引發的血案

來源:互聯網
上載者:User

1.WEB SERVER突然不停的RESTART,查LOGS時,發現WEB調用某個API時報錯;

2.查API,已經DWON了,重啟API恢複;

3.查API LOGS,發現MYSQL異常;

4.top,發現MYSQL佔用CPU達到100-300%……

5.繼續追查MYSQL,show processlist時,瞬間懵了。。。

650) this.width=650;" src="http://www.bkjia.com/uploads/allimg/131228/221941M95-0.jpg" title="showprocesslist.jpg" />


這條SELECT耗時274565s,導致一千多個thread處於waiting狀態。血淋淋的劊子手。。。

把這條SQL給開發確認後,kill掉這條SQL的id,恢複正常

最後善後!



感謝葡萄,join等提供的思路~~


補:

很多的反應圖太小,看不清。附上大圖一張資料與之前的不同,但格式是一樣的。)

650) this.width=650;" src="http://www.bkjia.com/uploads/allimg/131228/2219415129-1.png" title="showprocesslist.png" />

本文出自 “Wowking” 部落格,請務必保留此出處http://wowking.blog.51cto.com/1638252/1243400

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.