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 error

Discussion in 'Database Discussions' started by daveyb17, Apr 29, 2013.

  1. daveyb17

    daveyb17 Member

    Joined:
    Apr 29, 2013
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    HI All,

    I was hoping someone could help me with an issue i am having.

    All the contact forms that sit on sites utilizing MySql databases are running very very slowly, Sometime taking almost 50 - 60 seconds to send.

    These are sitting on wordpress (various versions) and opencart. So i know this isn't down to a particular CMS version or a particular plugin. As you can appreciate most people think that the form is broken and click off the form before it's finished.

    I have checked the process manager in WHM and the below keeps cropping up. I can kill it off and everything runs ok for a few moments and then it comes back and starts creeping up and up.

    Pid Owner Priority CPU % Memory % Command

    5258 (Trace) (Kill) mysql 0 10.7 0.3 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/domain-removed.xx.xx.err --open-files-limit=3220 --pid-file=/var/lib/mysql/domain-removed.xx.xx.err.pid

    I have tried repairing all the databases and they are all ok. Also tried restarting MySql and this again solves the issue for a few moments.

    so i checked what process are running and MySql seems rather high:-

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    5258 mysql 15 0 1113m 31m 5328 S 10.8 0.4 3:23.72 mysqld

    I have also checked what MySql processes are running but this is getting a rather high above my head as i am pretty new to this.

    +-----+----------------+-----------+----------------+----------------+------+--------------------+------------------+
    | Id | User | Host | db | Command | Time | State | Info |
    +-----+----------------+-----------+----------------+----------------+------+--------------------+------------------+
    | 189 | eximstats | localhost | eximstats | Sleep | 133 | | |
    | 523 | leechprotect | localhost | leechprotect | Sleep | 824 | | |
    | 651 | DELAYED | localhost | eximstats | Delayed insert | 133 | Waiting for INSERT | |
    | 683 | xxxxxxxx_wp204 | localhost | xxxxxxxx_wp204 | Sleep | 10 | | |
    | 694 | xxxxxxxx_wp811 | localhost | xxxxxxxx_wp811 | Sleep | 0 | | |
    | 695 | root | localhost | | Query | 0 | | show processlist |
    +-----+----------------+-----------+----------------+----------------+------+--------------------+------------------+


    if anyone could help that would be great! I would prefer if you could advise what the issue is and point me in the right direction of some documentation so i can learn whats going on / has happened rather than saying "this is the fix" :)

    thanks
    DaveyB
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,449
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    What makes you think its a MySQL issue? Is this a custom script that you created? If not, whats the contact form called exactly?
     
  3. daveyb17

    daveyb17 Member

    Joined:
    Apr 29, 2013
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    the reason i think it's a MySql issue as any sites not using a database run fine.

    No custom scripts at all and the contact forms range from cforms, contact form 7 to opencarts standard contact form.

    I have noticed that the sites using an MySql database have slowed down slightly as well but not to the extent the contact forms have.
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,449
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    How the forms are setup to send mail might be an issue. Have you checked your logs? Have you checked the community support forums for the contact forms for similar issues?
     
  5. daveyb17

    daveyb17 Member

    Joined:
    Apr 29, 2013
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    The forms were sending fine a week ago and if i load one of the sites up on a different server it works fine.

    As i mentioned i'm pretty new to this so not sure which error logs to look at.

    have tried using the standard php mailer and also via SMTP authentication and i still get the issue.
     
  6. daveyb17

    daveyb17 Member

    Joined:
    Apr 29, 2013
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    If this isn't a MySql error can anyone point me in the right direction of what the problem could be.
     
  7. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,449
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    The most basic way to look for errors for something like this might be in that accounts cPanel > Logs section, error logs. Access and try and use the contact form, then go to the error log there and look for any signs of clues.

    You could also check here:
    WHM » Server Status » Daily Process Log

    A bit more advanced, via shell logged in as root use might be to check the log here:
    /var/log/messages


    If the contact form was spiking MySQL, wouldn't it only be spiking resources when its being used? In other words, if you disabled the contact form, does the rest of the site run properly then?
     
Loading...

Share This Page