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.

Problem CPU 100% - mySQL logs

Discussion in 'Database Discussions' started by fronkj, Mar 18, 2015.

  1. fronkj

    fronkj Member

    Joined:
    Mar 18, 2015
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    France
    cPanel Access Level:
    Root Administrator
    Hi,

    I have a CPU usage on my server.

    Here's the process that takes almost all the processors time :

    /usr/sbin/mysql --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/...

    How can I be helped with this issue ?

    Thanks in advance !

    Regards


    Frank.
     
  2. 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,

    You can try running a command such as "mysqladmin processlist" to get a better idea of how which databases/tables are utilizing the most resources.

    Thank you.
     
  3. fronkj

    fronkj Member

    Joined:
    Mar 18, 2015
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    France
    cPanel Access Level:
    Root Administrator
    Hi,

    Here's the result :

    Id | User | Host | db | Command | Time | State | Info |
    +---------+------------------+-----------+-------------------------------+---------+------+--------------+------------------------------------------------------------------------------------------------------+
    | 4820431 | eximstats | localhost | eximstats | Sleep | 197

    I have removed the other lines as I think it's the one.

    Regards


    Frank.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Check the size of the eximstats database with a command such as:

    du -sh /var/lib/mysql/eximstats

    You may want to reduce the following value in "WHM Home » Server Configuration » Tweak Settings", under the "Stats and Logs" tab, if the database is too large:

    "The interval, in days, to retain Exim stats in the database"

    You can also follow the instructions in the following thread if you want to empty the database:

    http://forums.cpanel.net/threads/eximstats-not-reporting.455452/

    Thank you.
     
  5. fronkj

    fronkj Member

    Joined:
    Mar 18, 2015
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    France
    cPanel Access Level:
    Root Administrator
    Hi,

    Size is 1,9M. And my server is still at 100% of CPU usage. I don't know what to do as I don't understand where it comes from.

    This process :
    /usr/sbin/mysql --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/logfile

    is strange because file /var/lib/mysql/logfile remains empty. What happens ?

    Thanks for you help.

    Regards

    Frank.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    That's a normal MySQL process. It does not indicate a problem with MySQL. You may need to review the following thread in-case it's not MySQL causing your server load:

    Troubleshooting High Loads On Linux Systems

    Thank you.
     
  7. fronkj

    fronkj Member

    Joined:
    Mar 18, 2015
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    France
    cPanel Access Level:
    Root Administrator
    I will read this page

    But this process :

    /usr/sbin/mysql --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/logfile

    is always above 50% of CPU use. And the log error file "logfile" remains empty. Please confirm that's not the origin of my server's problem.

    Regards
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    I can't confirm that MySQL is not the cause of your server's CPU usage, but the listing of the MySQL error log in the process is normal.

    Thank you.
     
  9. fronkj

    fronkj Member

    Joined:
    Mar 18, 2015
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    France
    cPanel Access Level:
    Root Administrator
    Hi,

    But why does the log file remain empty ? I've never seen this line on my server's CPU usage list that high for so long.

    Regards
     
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Check /etc/my.cnf to see if you are using a custom log file for MySQL errors. If not, the default path to it should be:

    /var/lib/mysql/$hostname.err

    Restart MySQL and you should see data populated to the log.

    Thank you.
     
  11. fronkj

    fronkj Member

    Joined:
    Mar 18, 2015
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    France
    cPanel Access Level:
    Root Administrator
    Yes I had changed the log file location :
    general_log_file = "/var/log/mysql/mysql.log"

    I have just restarted mysql, but I keep on having this task running :

    /usr/sbin/mysql --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/logfile

    And file /var/lib/mysql/mysql.log remains empty.

    Any idea ?

    Thanks by the way for your patient help.

    Regards

    Frank.
     
  12. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    The process itself is normal, but feel free to open a support ticket using the link in my signature so we can investigate why the log file is not populated. You can post the ticket number here so we can update this thread with the outcome.

    Thank you.
     
  13. fronkj

    fronkj Member

    Joined:
    Mar 18, 2015
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    France
    cPanel Access Level:
    Root Administrator
  14. bersama saya

    bersama saya Registered

    Joined:
    Mar 22, 2015
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    indonesia
    cPanel Access Level:
    Root Administrator
    MySQL can the cause of your server's CPU usage and also memory increase dramatically. If you only have 512 Mb.. i suggest you to use myisam ,.dont use innodb setting.. because it use huge ram.. expesially on big database.. when ram increase..http://www.berita3jambi.com cpu also increase.. so what we can do next. I use in my web
     
  15. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    To update, our analysts found that permissions on /var/log/mysql were invalid. Updating the permissions to 0755 on this directory allowed for successful MySQL error logging.

    Thank you.
     
Loading...

Share This Page