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.

PHP websites slow but fast right after apache restarted

Discussion in 'Workarounds and Optimization' started by whnewbie, Sep 30, 2014.

  1. whnewbie

    whnewbie Member

    Joined:
    Jan 1, 2012
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    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.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  3. whnewbie

    whnewbie Member

    Joined:
    Jan 1, 2012
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    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?
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You may need to block the IP addresses in a firewall if you determine the requests are not legitimate.

    Thank you.
     
  5. WCAndrew

    WCAndrew Registered

    Joined:
    Jan 19, 2015
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    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.
     
Loading...

Share This Page