PHP websites slow but fast right after apache restarted

whnewbie

Member
Jan 1, 2012
12
0
51
cPanel Access Level
Root Administrator
Hi. I run CloudLinux 6 + CageFS + PHP Selector + latest cPanel / WHM (11.44) + Apache 2.4 + PHP 5.4 (native) + suPHP + MySQL 5.6. And I have given "plenty" of resources in CloudLinux (4 cores, 1GB RAM) and PHP config (512GB RAM). And I run a dedicated server with dual CPU and 8GB RAM. So the point is that I have given sufficient resources for each account on this machine.

Recently I find that PHP websites can load very slowly - even the CPU load is very low. But when I restart Apache, the PHP websites will run very fast again. It will then become slow again after like 3 to 5 minutes. I wonder if cPanel experts have any experience of this and how you resolve it. The system is running fine and WHM is really fast even when the PHP websites are slow. Is this something I should open a ticket about???

Thanks in advance.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello :)

You may need to consider switching from suPHP to DSO with Mod_Ruid2 or FCGI. I am moving this thread to our "Optimization" forum where you might receive more feedback on this type of topic.

Thank you.
 

whnewbie

Member
Jan 1, 2012
12
0
51
cPanel Access Level
Root Administrator
On further investigation, I found in Apache status that there are many requests to JPG files of a particular site. Not just once but every time I check. And they come free different IP addresses each time so I cannot actually block them.

I suspected it was hotlinking to the images causing the issue. So I added code to prevent hotlinking to images in .htaccess in that particular website. The performance has improved so far.

But the requests to JPG files are still there. I wonder if there is anyway to get rid of the requests once and for all???

I actually expected that cloudlinux would have stopped one account affecting the others. But it looks like the bandwidth stealing is the cause of the sites being slow. And cloudlinux doesn't seem to help with that?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
But the requests to JPG files are still there. I wonder if there is anyway to get rid of the requests once and for all???
You may need to block the IP addresses in a firewall if you determine the requests are not legitimate.

Thank you.
 

WCAndrew

Member
Jan 19, 2015
6
0
51
cPanel Access Level
Root Administrator
I've been facing the same issue for about a week and have been pulling my hair out, upgrading, accusing my VPS provider etc.

The domain users were using to access the site was a parked domain. After I changed my setup so the users were using the Primary Domain for the account, all the images on my site started loading up perfectly.