apache2 and php slow first load on Ubuntu VPS - something like mysqltuner but for apache?

Posted by talkingnews on Server Fault See other posts from Server Fault or by talkingnews
Published on 2011-01-31T10:15:08Z Indexed on 2012/09/09 3:40 UTC
Read the original article Hit count: 437

Filed under:
|

Ubuntu 10.10 64 bit VPS, 512Mb dedicated RAM. Mysql tuned so that sqltuner is completely happy. Used RAM never above 350Mb out of the 493 available. Load never exceeds 1.04 or so.

httpd.conf tuned as per all the guides for vps of that memory - amount of preforks, spares etc.

But for the FIRST load a site after having not visited for a while, it's taking ages.

First load: Parse Time: 3.576 - Number of Queries: 50 - Query Time: 0.019723195953369

Reload Parse Time: 0.096 - Number of Queries: 39 - Query Time: 0.0066126374511719

Subsequent reloads will be at this speed.

htop shows two items as soon as I load that page for the first time:

php-cgi /usr/sbin/apache2 -k start

I'm using suPHP but I've tried fast-cgi and cgi.

Stuck now, a weekend of tweaking has brought me nothing. Advice appreciated.

© Server Fault or respective owner

Related posts about apache2

Related posts about php