{"id":56,"date":"2012-07-01T13:10:54","date_gmt":"2012-07-01T18:10:54","guid":{"rendered":"https:\/\/www.falatic.com\/?p=56"},"modified":"2012-07-01T13:20:22","modified_gmt":"2012-07-01T18:20:22","slug":"elementary-mysql-did-it-in-the-cpu-with-the-the-leap-second","status":"publish","type":"post","link":"https:\/\/www.falatic.com\/index.php\/56\/elementary-mysql-did-it-in-the-cpu-with-the-the-leap-second","title":{"rendered":"Elementary! MySQL did it, in the CPU, with the the leap second!"},"content":{"rendered":"<p>I awoke to an alert from a small Ubuntu 12.04 server I have on <a href=\"http:\/\/www.linode.com\/\" target=\"_blank\">Linode<\/a>: lots of CPU usage this morning,which is odd since I haven&#8217;t logged in for a while. Hmm. Looked at the CPU graph first, and the high usage was all since exactly midnight. Hmm again.<\/p>\n<p>So, I groggily log in and start looking around, and immediately see that MySQL is using LOTS of CPU all by its lonesome. I immediately wondered if somehow a hacker got in or something (given the <a href=\"https:\/\/community.rapid7.com\/community\/metasploit\/blog\/2012\/06\/11\/cve-2012-2122-a-tragically-comedic-security-flaw-in-mysql\" target=\"_blank\">recently reported MySQL bug<\/a>) so I went to look for some hints on investigating that. On a whim (remembering the odd timing of this) I searched Google for &#8220;mysqld went to 90% cpu at midnight&#8221;. Sure enough, it&#8217;s probably a bug.<\/p>\n<p>Turns out, this weekend sports a rare &#8220;<a href=\"http:\/\/phys.org\/news\/2012-06-added.html\" target=\"_blank\">leap second<\/a>&#8220;&#8230; and that triggers a kernel bug which in turn causes MySQL to start eating CPU like a bad gambler at a casino buffet.<\/p>\n<p>I found the following suggestion (found <a href=\"http:\/\/www.sheeri.com\/content\/mysql-and-leap-second-high-cpu-and-fix\" target=\"_blank\">here<\/a> and <a href=\"http:\/\/blog.mozilla.org\/it\/2012\/06\/30\/mysql-and-the-leap-second-high-cpu-and-the-fix\/\" target=\"_blank\">here<\/a>) worked well enough for me on its own (fingers crossed anyway):<\/p>\n<pre>sudo\u00a0date -s \"`date`\" \u00a0# &lt;-- Mind the backticks!<\/pre>\n<p>I ran that and the problem immediately disappeared.\u00a0I didn&#8217;t need to reboot or restart mysqld (rebooting would also fix it apparently, but restarting mysqld would not).<\/p>\n<p>Hopefully this bit of advice serves you as well!<\/p>\n<!-- wpsso rrssb get buttons: buttons on archive option not enabled -->\n","protected":false},"excerpt":{"rendered":"<p>I awoke to an alert from a small Ubuntu 12.04 server I have on Linode: lots of CPU usage this morning,which is odd since I haven&#8217;t logged in for a <a href=\"https:\/\/www.falatic.com\/index.php\/56\/elementary-mysql-did-it-in-the-cpu-with-the-the-leap-second\" class=\"more-link\">[&hellip;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"Layout":"","footnotes":"","_links_to":"","_links_to_target":""},"categories":[1],"tags":[],"class_list":["entry","author-marty","post-56","post","type-post","status-publish","format-standard","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.falatic.com\/index.php\/wp-json\/wp\/v2\/posts\/56","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.falatic.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.falatic.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.falatic.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.falatic.com\/index.php\/wp-json\/wp\/v2\/comments?post=56"}],"version-history":[{"count":0,"href":"https:\/\/www.falatic.com\/index.php\/wp-json\/wp\/v2\/posts\/56\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.falatic.com\/index.php\/wp-json\/wp\/v2\/media?parent=56"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.falatic.com\/index.php\/wp-json\/wp\/v2\/categories?post=56"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.falatic.com\/index.php\/wp-json\/wp\/v2\/tags?post=56"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}