[Templates] CGI/TT vs SSI

Bryce Harrington bryce@osdl.org
Fri, 10 Oct 2003 10:42:15 -0700 (PDT)


On 10 Oct 2003, David Dyer-Bennet wrote:

> Tosh Cooey <tosh@1200group.com> writes:
>
> > After reading some of the things that Randall has suggested I was
> > thinking about making the "menu" static, but then I have to rebuild
> > after every change, and also lose a bit of dynamism.
> >
> > I'm running a mod_perl environment.
> >
> > Is this just a case of; "six of one, one-half dozen of the other" or
> > is forcing a Template->process call on hapless static HTML, just to
> > put in a menu, a bit of overkill?
>
> To a first approximation, CPU spent at "build" time is free.  You
> build so few times, compared to the number of times the page is
> viewed.  So unless you *need* minute-by-minute dynamic generation of
> your site, you win by using a build-time process to produce pages
> which are then served statically.  I've used this on the last couple
> of sites I've designed, and am liking it *very* much.  In both of them
> I do have a couple of live CGIs for things that really *do* change
> minute by minute.  I also have an automated every-day rebuild, so that
> scheduled events can be listed only for the current and future days,
> not letting the past events linger around.

I'd ditto these remarks.  The OSDL website is not huge - takes less than
a minute to rebuild - but we occasionally get high traffic spikes (such
as when we hired Linus).  The troubles we've had with using a build
system are more process related than efficiency related, but they've
been workable.

By the way, we've been experimenting with various versions of the Linux
kernel for the web server, as we're wont to do, and found some pretty
major performance benefits from upgrading from 2.4 to 2.6.  For example,
we'd typically seen load spikes in the 5-10 range on the webserver under
2.4 kernels, but with 2.6 we rarely see above 1, even including during
the traffic spikes mentioned above.  Obviously this is very anecdotal,
but it suggests that if you're strongly interested in maximizing
performance you may get more bang-for-the-buck to focus on getting a
good kernel.

(Btw, we've also encountered a few stability issues with the kernel on
our webserver, so if you're in a high availability situation you may
want to hold off a bit for 2.6 to mature.)

Bryce