The Community Forums

Interact with an entire community of cPanel & WHM users.
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MySQL is using all the time CPU at 20.0+ ?

Discussion in 'General Discussion' started by WebHostDog, Sep 15, 2006.

  1. WebHostDog

    WebHostDog Well-Known Member

    Joined:
    Sep 3, 2006
    Messages:
    144
    Likes Received:
    0
    Trophy Points:
    16
    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.
     
  2. gflamerich

    gflamerich Well-Known Member

    Joined:
    Jul 21, 2003
    Messages:
    122
    Likes Received:
    0
    Trophy Points:
    16
    #2 gflamerich, Sep 15, 2006
    Last edited: Sep 15, 2006
  3. WebHostDog

    WebHostDog Well-Known Member

    Joined:
    Sep 3, 2006
    Messages:
    144
    Likes Received:
    0
    Trophy Points:
    16
    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 ?
     
  4. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    36
    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
     
  5. WebHostDog

    WebHostDog Well-Known Member

    Joined:
    Sep 3, 2006
    Messages:
    144
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Website Owner
    Kernel 2.4.21-37.ELsmp

    it is CentOS 3.8

    You think this may be the issue ?

    Thanks.
     
  6. rhenderson

    rhenderson Well-Known Member

    Joined:
    Apr 21, 2005
    Messages:
    785
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Oklahoma
    cPanel Access Level:
    Root Administrator
    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.

    in the above get the pid 31424 and from shell strace -p 31424 see what you get for the output on that pid.
     
    #6 rhenderson, Sep 18, 2006
    Last edited: Sep 18, 2006
  7. WebHostDog

    WebHostDog Well-Known Member

    Joined:
    Sep 3, 2006
    Messages:
    144
    Likes Received:
    0
    Trophy Points:
    16
    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.
     
Loading...

Share This Page