httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <n...@webthing.com>
Subject Re: [users@httpd] Server Side Include (SSI) is slower than PHP ?
Date Mon, 18 Feb 2008 14:47:51 GMT
On Mon, 18 Feb 2008 15:49:09 +0800
"howard chen" <howachen@gmail.com> wrote:

> SSI
> ===
> 
> <!--#include virtual="modules/1.html" -->
> <!--#include virtual="modules/2.html" -->
> <!--#include virtual="modules/3.html" -->
> <!--#include virtual="modules/4.html" -->
> <!--#include virtual="modules/5.html" -->

There is a subrequest per include, so SSI gets slower
as the number of includes increases.

> PHP
> ===
> 
> <?php
> 
> include("./modules/1.html");
> include("./modules/2.html");
> include("./modules/3.html");
> include("./modules/4.html");
> include("./modules/5.html");
> 
> ?>

There is no per-request overhead other than sending you the
files themselves (which the operating will cache if they're
being frequently requested).

> I was surprised that PHP is faster, i.e.
> 
> ab -n 2000 -c 10  http://localhost/benchmark.php => 99 reqs/sec
> ab -n 2000 -c 10  http://localhost/benchmark.shtml => 61 reqs/sec

That seems slow to me.  At least if you have hardware that was
new anytime in the last ten years.

In any case, with a real browser (and on the 'net in general - 
this doesn't rely on one user continually requesting a testpage),
that'll be dwarfed by cacheing effects.  The XBitHack will get
you that with SSI.  With PHP, it's up to your script.

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message