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.

All MySQL-Based Sites Slow on Server

Discussion in 'Database Discussions' started by wcs2, Jul 8, 2015.

  1. wcs2

    wcs2 Member

    Joined:
    Apr 11, 2014
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    For the past week or so (and right after upgrading to WHM 11.50 build 22) all the MySQL powered sites and tools on my server (10 or so WordPress sites and one small tool) have been very slow to load. I've had the "failed to connect to database" error 4 times in 10 days. Restarting the service restores the connection.

    When I run mysqlcheck --all-databases everything is listed as OK.
    I don't see any unusual load on the server overall.
    Everything is up under Service Status.

    The only thing odd I see is under Load Averages, I see that one specific XMLRPC.php file is responsible for 18% of the CPU. (When I try to trace it, I get the message
    attach: ptrace(PTRACE_ATTACH, ...): No such process)

    Anyone have an idea what I can do to find out more and fix the issue?
    Thanks!

    Running
    WHM 11.50.0 (build 22)
    MySQL 5.6.23
    CENTOS 6.6
     
    #1 wcs2, Jul 8, 2015
    Last edited by a moderator: Jul 9, 2015
  2. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,145
    Likes Received:
    34
    Trophy Points:
    48
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hello,

    May be there is a XMLRPC.php attack on your one of the domain. Please try to add following code in your domain .htaccess file and check it

    Code:
    # BEGIN protect xmlrpc.php
    <files xmlrpc.php>
    order allow,deny
    deny from all
    </files>
    # END protect xmlrpc.php

    Also regarding the mysql, I will suggest you please try to run mysqltuner scripts on your server.
     
    #2 24x7server, Jul 9, 2015
    Last edited by a moderator: Jul 9, 2015
  3. wcs2

    wcs2 Member

    Joined:
    Apr 11, 2014
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thanks. I'll give that a try now.
     
  4. wcs2

    wcs2 Member

    Joined:
    Apr 11, 2014
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    This was successful, and then something went wrong (and it's probably my fault). As soon as I added the protection code for XLMRPC, everything sped up. I ran mysqltuner and things were better still. It recommended I optimize the tables, which I did and then everything slowed back down again. I'm banging my head against the wall because the first two steps really did the trick.
    Restarting MyQL and rebooting the server have not helped the speed get back to where it was. Should I wait 24 hours and run mysqltuner again?
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,666
    Likes Received:
    646
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Yes, this is a good idea. Often times you need to run the tuner a few times after making adjustments if the initial changes don't improve performance over an extended time period.

    Thank you.
     
  6. wcs2

    wcs2 Member

    Joined:
    Apr 11, 2014
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thanks again. I really appreciate it.
     
Loading...

Share This Page