high-traffic site loads quickly, low-traffic site loads slow

Discussion in 'Install/Configuration' started by ARPLink, Dec 10, 2012.

  1. ARPLink

    ARPLink Member


    For some time I've been dealing with a very weird issue. A part of the sites I host have a normal load time, but they have some traffic(from 50-100 visitors/day to 1000-2000 visitors/day). My problem is with low trafic sites(5-10 visitors/day). The load time for these low trafic sites tends to reach 40 seconds sometimes, but after the first visitor loads the site, if another visitor comes along in the next 30-60 minutes, the load time is instant.

    My server is a Xeon with 8 Gb of RAM and 4 SATA disks in RAID 10. LiteSpeed is installed on a CloudLinux XenServer VPS and has alocated 7 cores and 7 Gb of RAM.

    Here are some screenshots of Litespeed configuration and HTop.

    LiteSpeed Monitor:

    Server Process + Using Apache Config File:


    Request/Response + GZIP:

    Per Client Throttling + External Application Resource:

    External App - LSPHP5:
  2. ARPLink

    ARPLink Member

    Here's HTop:
  3. webizen

    webizen Well-Known Member

    it sounds like it takes a long time to compile php script the first time. since your opcode cache TTL is longer than 60 mins, next request hits opcode cache, hence fast.

    check your i/o wait and see if your hard drive slow down php script loading from disk.

    another thing you can try: run a cronjob to pull the low traffic site more often to refresh opcode cache before it expires.
  4. ARPLink

    ARPLink Member


    Thanks for the advice. I will monitor I/O for a few days, but from what I've seen so far in the last 48 hours it stais under 5%(in most cases around 1-1.5%).

    As for the cron, it's a good ideea but impossible to apply because there are a lot of small sites and I don't know all of them.(it's a shared server)

    Is there any way to make litespeed compile the php scripts faster or extend the opcache TTL time to 6 hours, for example? :)

    Also, does my configuration look ok considering my server's resources?

    Thank you

    P.S. The server is on cPanel and has a remote dedicated mysql server attached to it. Could this be the reason for the slow compilation of PHP scripts?
  5. NiteWave

    NiteWave Administrator

    good point, looks more reasonable -- database warming up has caused the delay.

    to verify this, just put a phpinfo() page under the documentroot, if phpinfo() is fast at any time, then the culprit is mysql; otherwise, it may be related to litespeed.

Share This Page