All MySQL-Based Sites Slow on Server

wcs2

Member
Apr 11, 2014
23
0
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
 
Last edited by a moderator:

24x7server

Well-Known Member
Apr 17, 2013
1,912
99
78
India
cPanel Access Level
Root Administrator
Twitter
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.
 
Last edited by a moderator:

wcs2

Member
Apr 11, 2014
23
0
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?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
Should I wait 24 hours and run mysqltuner again?
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.