[Phpug] Caching / Optimising / Speeding Up Php Scripts / Sites?

Kae Verens kae at webworks.ie
Fri Jun 29 15:07:39 IST 2007


Michele Neylon wrote:
> Hi all
> 
> One of those $random and rather general queries ....
> 
> Does anyone have any secret foo to help speed up sites running php /
> mysql on apache2.
> I've already got APC installed but Apache keeps segfaulting :(
> 
> The server's going to be getting an extra 2 gigs of ram next week (it's
> sitting on my desk!) but until then I need to keep it running

optimising is a magic all of its own. you'd really have to say why it's 
segfaulting.

In general, though - I'd say try to reduce the number of MySQL queries the PHP 
is running, and the number of includes. The less PIDs running around the 
system, the lower the system's load, the better its chance of not dying.

you can speed up delivery of sites by doing little things like having all the 
static images, CSS and JavaScript hosted on a separate domain name, combining 
images whenever possible, and caching (in database if necessary) published 
pages which are not likely to change for a day or so, instead of dynamically 
creating them on each view.

Kae


More information about the Phpug mailing list