Page 1 of 1

MySQL High CPU?

Posted: Wed Jul 04, 2012 5:03 am
by Kalimari
Noticed MySQL server CPU was running at almost 100%, checked process list, etc. nothing unusual. Turned to Google and found the issue + solution:

http://blog.mozilla.org/it/2012/06/30/m ... d-the-fix/

Basically, UTC has to compensate for the slowing rotation of the earth due to tidal changes by adding a leap second, MySQL doesn't like this. After stopping ntp, running date -s "`date`" and restarting ntp, MySQL CPU came back to normal within 5 mins.

Hopefully this will help someone else fix the problem quickly.

Re: MySQL High CPU?

Posted: Wed Jul 04, 2012 1:35 pm
by faris
we've been lucky in that we've seen no probs on any of our systems. I was expecting at least one to go nuts, and if not a system then something with an embedded linux and ntpd (e.g. 10+ wifi access points).

Re: MySQL High CPU?

Posted: Wed Oct 10, 2012 9:55 am
by Choji
We just had MySQL causing high CPU.

So basically, would something like
date -s 'date -u'
supposed to fix it, when it happens?

I only reached this thread after we had restarted our server.
It wasn't so clear what the cause was, apart from the fact it's MySql and issues with system time.
Is it possible for some process - perhaps an activity on a hosted domain to have triggered this?
If so, is there a log I should be looking?

Pretty sure it's not in /var/ossec/logs/alerts/alerts.log

Choji

Re: MySQL High CPU?

Posted: Wed Oct 10, 2012 10:55 am
by scott
Theres no log for that exactly, its just something you observe. That being said, have you observed it?

Re: MySQL High CPU?

Posted: Wed Oct 10, 2012 11:50 am
by Choji
It was visible that using the 'top' command that mysql (command mysqld) was using up CPU percentage.
Other than that I saw as I tried to get on the plesk control page, some "ERROR: Zend_Db_Table_Row_Exception".
Of course, I wasn't able to go into any domains we hosted.
Everything was slow on command line and eventually the network connection was interrupted and I couldn't get back in, at which point I had to restart the server.
Anything I should have checked?

Re: MySQL High CPU?

Posted: Wed Oct 10, 2012 12:00 pm
by scott
mysqltuner is a good place to start there