Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

httpd and mysql long running process

Discussion in 'General Discussion' started by filth, Oct 2, 2007.

  1. filth

    filth Active Member

    Jun 18, 2004
    Likes Received:
    Trophy Points:
    Hi all

    Recently (last couple of weeks) I have found that mysql and apache have been eating my server resources pretty badly. When I execute a top command I find that 1 or the other has an extremely long running process. For example the following is taken from a top command 5 minutes ago:-

    24256 mysql 15 0 101m 6704 2472 S 5.3 0.9 11:53.69 mysqld

    As you can see it has been running for almost 12 hours. (and consuming a lot of memory). When I try the 'watch mysqladmin proc' command there was only 2 running and nothing looked out of ordinary. The longest I have seen so far is a process running for 23 hours.

    Has anyone any idea what could cause this? Is mysql simply not closing a dormant connection?

    As soon as I restart the service the load of the server returns to a very good level but before the commands they can be anywhere between 4 and 6 on a single core server.
  2. cPanelKenneth

    cPanelKenneth cPanel Development Staff Member

    Apr 7, 2006
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    When your server is under this load, execute the following:

    # mysqladmin processlist
    It will display the queries are running. The important column is the State column. If the entry for the first query is Locked then it will block the other queries that need to access the same table(s).

    A quick way of determining if locks are your problem is to execute:

    # mysqladmin debug
    and check the output in the /var/lib/mysql/*.err log. It will display a list of locks.

    Locks may or may not be your particular issue. Please consider reading the MySQL manual, particularly the sections pertaining to optimization and administration. The manual contains valuable insight into determining what exactly is causing issues with your server.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice