MySQL High CPU?

Support/Development for MySQL, MariaDB, and other database systems
Kalimari
Forum Regular
Forum Regular
Posts: 526
Joined: Wed Jan 02, 2008 3:21 pm
Location: United Kingdom

MySQL High CPU?

Unread post 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.
faris
Long Time Forum Regular
Long Time Forum Regular
Posts: 2321
Joined: Thu Dec 09, 2004 11:19 am

Re: MySQL High CPU?

Unread post 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).
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
Choji
Forum User
Forum User
Posts: 28
Joined: Mon Sep 10, 2012 10:00 am
Location: United Kingdom

Re: MySQL High CPU?

Unread post 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
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8330
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Re: MySQL High CPU?

Unread post by scott »

Theres no log for that exactly, its just something you observe. That being said, have you observed it?
Choji
Forum User
Forum User
Posts: 28
Joined: Mon Sep 10, 2012 10:00 am
Location: United Kingdom

Re: MySQL High CPU?

Unread post 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?
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8330
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Re: MySQL High CPU?

Unread post by scott »

mysqltuner is a good place to start there
Post Reply