Re: Server Side Include (SSI) is slower than PHP ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 18 Feb 2008 15:49:09 +0800
"howard chen" <howachen@xxxxxxxxx> 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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux