I noticed that MySQL is using way more CPU than usual on my workstation (usual is 1% or less, because this is my workstation, not a server).
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
14004 mysql 20 0 536m 44m 7136 S 141 1.2 65:24.72 mysqld
I looked in my slow log and there are no queries at all. I ran tail -f on the general log to see what was running and there was nothing at all there either. The MySQL processlist is empty as well.
+-----+------+-----------+----+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-----+------+-----------+----+---------+------+-------+------------------+
| 165 | root | localhost | | Query | 0 | | show processlist |
+-----+------+-----------+----+---------+------+-------+------------------+
Every other post I've seen is related to high CPU usage due to a specific query, but I've got no queries running at all. Does anyone know how to determine why MySQL is using all that CPU?
In case it matters, here's more info about my system:
Linux kubuntu 3.2.0-26-generic
Server version 5.5.24-0ubuntu0.12.04.1-log
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /var/run/mysqld/mysqld.sock
Uptime: 57 min 8 sec
Threads: 1 Questions: 406 Slow queries: 0 Opens: 567 Flush tables: 1
Open tables: 140 Queries per second avg: 0.118
1 Answer 1
had the same problem, here is a solution:
http://blog.mozilla.org/it/2012/06/30/mysql-and-the-leap-second-high-cpu-and-the-fix/
Everything happens because of "1" second.
-
The most recent "leap second" was triggered on July 1st 2015 (see hpiers.obspm.fr/iers/bul/bulc/bulletinc.49). I just noticed my MySql-Daemon spinning (probably going unnoticed for several days). Following the instructions helped!Marcus Rickert– Marcus Rickert2015年07月07日 22:55:41 +00:00Commented Jul 7, 2015 at 22:55
-
URL doesn't Exist.Jenson M John– Jenson M John2023年12月12日 23:11:34 +00:00Commented Dec 12, 2023 at 23:11
-
@JensonMJohn yeah well it was 11 years before your comment. It can be seen here - planet.mysql.com/entry/?id=33709 - if you still need it (I know, 1.5 years after your 2023 comment!)Sheeri– Sheeri2025年07月09日 17:50:43 +00:00Commented Jul 9 at 17:50
-
@Sheeri Ha Ha. I had no idea the Earth had done 11 full laps around the Sun since then!! Thanks anyway. 👍🏽😀Jenson M John– Jenson M John2025年07月27日 07:43:43 +00:00Commented Jul 27 at 7:43