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 high cpu

Discussion in 'Database Discussions' started by sahostking, Jun 8, 2015.

  1. sahostking

    sahostking Well-Known Member

    Joined:
    May 15, 2012
    Messages:
    300
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Cape Town, South Africa
    cPanel Access Level:
    Root Administrator
    Hi not sure why mysql is having high cpu usage.
    I've ran mysqltuner and still does not work.

    192149 mysql 20 0 13.7g 2.8g 6024 S 131.7 36.1 283:34.43 mysqld


    It's quite strange as if I look at the mysqladmin processlist I get this:


    +--------+----------------+-----------+--------------------+---------+------+----------------+------------------------------------------------------------------------------------------------------+----------+
    | Id | User | Host | db | Command | Time | State | Info | Progress |
    +--------+----------------+-----------+--------------------+---------+------+----------------+------------------------------------------------------------------------------------------------------+----------+
    | 206827 | root | localhost | information_schema | Sleep | 20 | | | 0.000 |
    | 206829 | root | localhost | information_schema | Sleep | 4609 | | | 0.000 |
    | 206831 | root | localhost | information_schema | Sleep | 4610 | | | 0.000 |
    | 211870 | bmxdirec_wp | localhost | bmxdirec_wordpress | Query | 0 | Sending data | SELECT * FROM wp_options LIMIT 10 OFFSET 298590 | 0.000 |
    | 214431 | eximstats | localhost | eximstats | Sleep | 1 | | | 0.000 |
    | 215115 | root | localhost | mysql | Query | 64 | Opening tables | SELECT TABLE_SCHEMA as DB,SUM(DATA_LENGTH)+SUM(INDEX_LENGTH) AS SPACEUSED from information_schema.ta | 0.000 |
    | 215234 | stirling_wp315 | localhost | stirling_wp315 | Sleep | 2 | | | 0.000 |
    | 215236 | atomicco_wp833 | localhost | atomicco_wp833 | Sleep | 0 | | | 0.000 |
    | 215238 | root | localhost | | Query | 0 | init | show processlist | 0.000 |
    +--------+----------------+-----------+--------------------+---------+------+----------------+------------------------------------------------------------------------------------------------------+----------+


    Any ideaS?
     
  2. kamall

    kamall Active Member

    Joined:
    Mar 17, 2012
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Bethune France
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello
    Did you check mysql db size?
    here is the code you can check which db is too big.
    Code:
    SELECT table_schema "database", sum(data_length + index_length)/1024/1024 "size in MB" FROM information_schema.TABLES GROUP BY table_schema;
    
    Or simply try to repair a!! tables on db .https://dev.mysql.com/doc/refman/5.0/en/rebuilding-tables.html

    Regards
    Kamall;
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    Did you make any changes suggested by the MySQL tuner? Do you have the output from it?

    Thank you.
     
Loading...

Share This Page