Re: is mod_perl better for CGI application?



"John" <john1949@xxxxxxxxx> writes:

We use Perl primarily to write our website. The site uses CGI.pm
extensively. So, every page begins my $x=param('x') etc and depending
on whether it is 'undef' will jump to some routine or other. Lots of forms.

Handling incoming parameters is a wash - it has to be done either way, as
well as with FastCGI (which another reply mentioned), and none of them is
notably faster than the others at doing it.

The "big win" for mod_perl or FastCGI is script startup time. With a CGI,
the server has to start a new perl instance, which then has to load and
compile your script and any modules it uses, before it can even begin to
parse any parameters. Also, if your script accesses a database, it needs
to establish a connection to the DB and log in.

With mod_perl or FastCGI, most of that per-hit overhead goes away. Your
script is compiled only once. It can connect to a DB once, and then re-use
that connection for every hit. Each hit then has about as much overhead as
a function call.

sherm--

--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
.



Relevant Pages

  • PLT Scheme, ffi, libfcgi & mod_fastcgi
    ... FastCGI then I can write a small app in Scheme. ... Below is my sample script. ... the Apache error log increments with each request to the script. ...
    (comp.lang.scheme)
  • Re: How to test if I got Mod_Perl in apache?
    ... I'd be interested in hearing more about your typical configuration. ... you use fastcgi or Pperl? ... I believe that statement assumes a typical CGI ... I just benched the smallest and tightest script I could come up with: ...
    (comp.lang.perl.misc)
  • Re: suPHP - secure/reliable?
    ... From what I saw in the FastCGI documentation you need to do some ... > and running, apart from makeing install? ... SuexecUserGroup username groupname ... test.php script file, just the ownership of /cgi-bin and /cgi-bin/php. ...
    (freebsd-questions)
  • Re: Q: How to improve CGI performance for this?
    ... The problem I'm having is with a CGI script that needs to load and ... I don't know much about FastCGI, ... PHP is much more commonly run as a module, ...
    (comp.lang.perl.misc)
  • Re: for each file loop question on reading variables
    ... Is the thing that you want to do based on filename a control lfow thing or is it a data thing. ... In the Control Flow you may want to use the Script task. ... If what you want to do is simply make a FF Connection Manager point to this new file then you need to look at property expressions. ... Highlight the Conection Manager, hit F4, ind the Expressions item and hit the ellipses. ...
    (microsoft.public.sqlserver.dts)