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.

high mysql load

Discussion in 'Workarounds and Optimization' started by itajooba, Sep 20, 2010.

  1. itajooba

    itajooba Member

    Joined:
    Jul 2, 2008
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    i noted several time that there is a process running in my WHM, which says :

    ----
    /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/ns1.myhost.com.err --pid-file=/var/lib/mysql/ns1.myhost.com.pid
    ----
    does anyone have any idea what is this ? some time when the site get too slow then i have to kill this process to start running the website smoothly.

    My query is :

    1. How can i disable it ?
    2. is it very required thing ?
     
  2. Metro2

    Metro2 Well-Known Member

    Joined:
    May 24, 2006
    Messages:
    376
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    I'm not a "guru" or an expert on this topic, so you should definitely get more input from the other users here, but as someone who has experienced what you're talking about these are my thoughts/opinions:

    First, I don't think you want to try to disable that at all. That is an error log of mySQL errors being written to it in real time and the information in the log can in some cases be essential to resolving database driven account issues.

    Second, a large number of those error process being reported (PID) can be caused by a number of things and it's going to be up to you (or your data center or a hired sysadmin) to truly distiguish the source, but here are a few things that can cause the constant stream and high load of those mysql error processes:

    - An account(s) on your server could be running a script that is very poorly configured or possibly running with a very corrupt database

    - You might have a server that is under-powered for handling the amount of database-driven sites/scripts that you're hosting on it (in which case the solution can sometimes be to add more RAM, and/or upgrade your hardware all-together)

    - Your my.cnf file (your mySQL config) might need to be optimized to handle the type of database-driven sites that you're hosting and to handle the sheer VOLUME of traffic and requests coming from a particular account (or number of accounts)

    In my case when I had that problem on a particular server, it turned out to be a combination of all of the above. mySQL needed to be optimized by an expert, I needed to upgrade to a more powerful server, and there were a couple of PHP scripts running under a customer account that were poorly coded with far outdated syntax and I had to address that with the customer directly (basically letting them know that their script was throwing constant errors due to bad coding and DB misconfiguration).

    So whatever you do, I'd say do not attempt to stop the reporting processes and definitely do not delete any files before you get more advice here and perhaps have a more experienced / expert sysadmin examine the server for you while these mySQL PID errors are overloading it.

    Good luck, and definitely get more opinions than just mine. Even after many years of running cPanel servers I'm still not comfortable doling out advice even when sometimes I might be right.
     
  3. itajooba

    itajooba Member

    Joined:
    Jul 2, 2008
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Hi 'Metro2',

    Thanks for the detail reply, i understand the process you have replied. I am very much sure about the server conflagration.

    How can we find out which script is eating up the recourse ?

    Regards,
    Shashi Kant
     
  4. GaryT

    GaryT Well-Known Member

    Joined:
    May 19, 2010
    Messages:
    321
    Likes Received:
    3
    Trophy Points:
    16
    Almost everyone will have something like that above, Just basicly saying what the user of mysql is, where its saving logs and such. Its not a problem.

    Going of your post, If you go in my.cnf you will see the output in there, eg:

    user=mysql
    Remove that line then, The page where you got those stats, probable running processes, Then you will see

    user: mysql gone..

    Its just the settings based on your my.cnf

    This process, Well on me uses 0% CPU and 5MB memory on all servers. Noting to worry about.

    cPanel staff may explain things much better, They will reply, Just hang in there :)
     
  5. nxweb

    nxweb Active Member

    Joined:
    Oct 29, 2008
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    That is just the running MySQL process, including the options that were used to start it (such as log file location etc). If you disable that, you disable MySQL.

    What you need to do if it's using a lot of resources is a identify the queries cause the it. The command "mysqladmin pr" is good place to start, it shows current queries. You also should enabled slow-query logging in your my.cnf so you can review the slow query log for bad queries.

    Also, look at the daily process stats in your WHM, and look for the accounts using .4% MySQL resources or more daily. They are a good starting point to find problems.

    But that process you mentioned like I said is just the command that runs MySQL. If you are seeing MySQL using a lot of resources, it is not the actual process. It is the combination of the scripts and other program on the server using MySQL.
     
Loading...

Share This Page