NYCPHP Meetup

NYPHP.org

[nycphp-talk] Minimal overhead

Paul Houle paul at devonianfarm.com
Sun Sep 2 08:55:15 EDT 2007


Elliotte Harold wrote:
> Suppose I don't want it to be so obvious that I'm using PHP on a site, 
> Or that I just want the freedom to not always use PHP in a given 
> document. Thus I decide to configure Apache to treat all .html files 
> as PHP files.
>
> How much overhead does this add for the common case when a file only 
> contains static data, no PHP? Would I notice the hit?
>
    You should measure this yourself using tools such as ab 
(ApacheBench,  included with the Apache distribution)

     I benched out an Apache 2 installation on a somewhat beefy Linux 
machine about two years ago.  Apache could serve about 2000 hits/sec of 
plain HTML files and around 400 hits/sec of simple PHP files.

    About five years ago I developed a simple PHP system that put 
templating on existing HTML documents.  I clocked this at around 100 
hits/sec,  which is around 8 million a day.

    There is substantial overhead in processing PHP,  but most people 
won't notice it unless they have very high traffic sites or are in a 
very resource constrained environment.





More information about the talk mailing list