On Sun, May 27, 2001 at 09:51:55PM -0500, David Dyer-Bennet wrote:
> > Using perl-5.00503, on RedHat 6.2, each perl request needed to fork/exec the
> > perl interpreter, which takes 8Mb of core. If you get 5 simultaneous requests,
> > you are already over the core size of ALL the servlets. Remember this is just
> > one cgi and the site has hundreds. 
> 
> Yep, that's of course the problem of Perl (and not PHP or Cold Fusion).

Correction:  Having to spawn external processes to handle requests is
a problem of CGI.  Apache has a FastCGI module (mod_fastcgi) which
will cache CGI scripts to avoid this; I've never used CGI (fast or
otherwise) so I can't say whether it allows the cached CGIs to share
their environment or not.  Apache also has mod_perl, which loads a single
instance of the perl interpreter and any perl modules on startup, thus
completely avoiding these sorts of problems.

These may seem to be perl problems because perl has traditionally been
(and still frequently is) used via CGI calls, but they're actually
caused by CGI.  A CGI program written in C or using a standalone Java
interpreter would be just as bad.

> That's not a total surprise.  Um, were you thinking of the thing whose
> name I can't remember that lets you do perl embedded in the page
> (which I think depends on mod_perl), or is there something clever to
> do with mod_perl itself that helps directly?  (Kinda ignorant about
> mod_perl obviously).

Install mod_perl, write your perl code in a module-friendly fashion (IIRC,
standard CGIs can be used as modules, but, again, I haven't done that,
so I'm not sure), load your scripts as modules, and all will be Good.

You're thinking of embedded perl, which I also haven't messed with, but,
according to ORA's _Writing Apache Modules in Perl and C_, "Embperl and
ePerl packages... build on mod_perl to create a Perl-like programming
language embedded entirely within server-side includes."  I would expect
this to perform less well than straight mod_perl, both because of the
SSI overhead and because the perl code would have to be recompiled (yes,
perl uses something similar to Java's JIT compilation these days) for
each request, where perl modules are compiled once at server startup.

-- 
That's not gibberish...  It's Linux. - Byers, The Lone Gunmen
Geek Code 3.12:  GCS d? s+: a C++ UL++++$ P++>+++ L+++>++++ E- W--(++) N+
o+ !K w--- O M- V? PS+ PE Y+ PGP t 5++ X+ R++ tv+ b+ DI++++ D G e* h r y+