[oclug][OT] Perl CGI
milan.budimirovic at sympatico.ca
Wed Nov 13 19:47:18 EST 2002
Jon Earle wrote:
> Does anyone use the CGI.pm module for creating webpages using perl? Is it
> too much overhead to worry about? Does it adversely affect performance?
> Worth bothering with? Other thoughts?
The answer here is "it depends", as with any question regarding coice of
web programming language. I personally think that the performance issue
is grossly overstated for anything but the busiest websites, and if it
does become an issue, you can do a couple of things:
1. Install mod_perl and run the CGI scripts -- with very minor
modifications -- using Apache::Registry. This spares you the biggest
performance hit with CGI.pm: namely, the overhead of loading the Perl
interpreter on every page hit.
2. Throw more hardware at the solution. No shame in that.
On the other hand, if performance is a real issue, and you have root
access to the server, you can go with mod_perl handlers instead of CGI
scripts. In addition to not having to load the Perl interpreter on every
page hit, you also don't have every program recompiled on every page
hit. As well, if you're connecting to a database, Apache::DBI maintains
a cache of persistent database connections for you. So there are huge
There's a ton of other reasons for using mod_perl, and a ton of reasons
**not to**. Go to http://apache.perl.org for more information.
BTW, there's finally an O'Reilly book on HTML::Mason. Reminder to self:
must buy copy soon. :=))
More information about the OCLUG