MySQL is using all the time CPU at 20.0+ ?

WebHostDog

Well-Known Member
Sep 3, 2006
143
1
166
cPanel Access Level
Website Owner
Hello,
This is CentOS system with CPanel Stable and MySQL 4.1.21 and the MySQL is using a lot of CPU constantly :


mysql 31424 21.5 1.8 286172 38828 pts/2 S 15:58 0:34 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --



On other boxes this CPU value is very low.


What may be the problem ?



Thanks.
 

WebHostDog

Well-Known Member
Sep 3, 2006
143
1
166
cPanel Access Level
Website Owner
The question is that is doing nothing :


+--------+------+-----------+----+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+--------+------+-----------+----+---------+------+-------+------------------+
| 119843 | root | localhost | | Query | 0 | | show processlist |
+--------+------+-----------+----+---------+------+-------+------------------+

and it is a CPU use in ps aux :


mysql 31424 26.5 6.0 325128 123704 ? S Sep15 387:47 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --


:) very strange what may be the issue ?
 

jayh38

Well-Known Member
Mar 3, 2006
1,212
0
166
I had the same problem just a while ago. Hardly any requests at all, none for the most part but mysql sucking up 20% or more.

Booted into the latest kernel, everything was fixed.. which kernel are you booted in?

uname -a
 

WebHostDog

Well-Known Member
Sep 3, 2006
143
1
166
cPanel Access Level
Website Owner
Kernel 2.4.21-37.ELsmp

it is CentOS 3.8

You think this may be the issue ?

Thanks.
 

rhenderson

Well-Known Member
Apr 21, 2005
784
2
168
Oklahoma
cPanel Access Level
Root Administrator
WebHostDog said:
Hello,
This is CentOS system with CPanel Stable and MySQL 4.1.21 and the MySQL is using a lot of CPU constantly :


mysql 31424 21.5 1.8 286172 38828 pts/2 S 15:58 0:34 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --



On other boxes this CPU value is very low.


What may be the problem ?


Thanks.
I had this problem as well about 3 weeks ago on a CentOS server. I straced the pid and could see the error (Cannot remember exactly what is said, but it looked like MySQL was looping) anyway I ran the mysqlup --force and repaired the problem.

mysql 31424 26.5 6.0 325128 123704 ? S Sep15 387:47 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --
in the above get the pid 31424 and from shell strace -p 31424 see what you get for the output on that pid.
 
Last edited:

WebHostDog

Well-Known Member
Sep 3, 2006
143
1
166
cPanel Access Level
Website Owner
strace -p gives this :


setsockopt(126, SOL_IP, IP_TOS, [8], 4) = -1 EOPNOTSUPP (Operation not supported)
futex(0x84f1f44, FUTEX_WAKE, 1) = 1
select(5, [3 4], NULL, NULL, NULL) = 1 (in [4])
fcntl64(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0
accept(4, {sa_family=AF_FILE, path="†“Х«Ъї"}, [2]) = 126
fcntl64(4, F_SETFL, O_RDWR) = 0
getsockname(126, {sa_family=AF_FILE, path="/var/lib/mysql"}, [28]) = 0
fcntl64(126, F_SETFL, O_RDONLY) = 0
fcntl64(126, F_GETFL) = 0x2 (flags O_RDWR)
fcntl64(126, F_SETFL, O_RDWR|O_NONBLOCK) = 0
setsockopt(126, SOL_IP, IP_TOS, [8], 4) = -1 EOPNOTSUPP (Operation not supported)
futex(0x84f1f44, FUTEX_WAKE, 1) = 1
select(5, [3 4], NULL, NULL, NULL <unfinished ...>



Thanks.