Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: mod_perl or CGI.pm?

by thraxil (Prior)
on May 14, 2004 at 15:33 UTC ( [id://353399]=note: print w/replies, xml ) Need Help??


in reply to mod_perl or CGI.pm?

so my question is... Are there any other reasons that you might choose one exclusively over the other?

reasons you would want to use mod_perl:

  • you need to have access to other parts of the apache request cycle besides just content production. eg, you need to hook into the authentication layer or the logging layer.
  • your app will be hit frequently and needs to have low latency in the response.
  • your app would benefit from in-memory persistence.

reasons to stick to CGI:

  • it needs to be deployable on servers where mod_perl isn't available (of course, with Apache::Registry, you can still deploy any CGI script with mod_perl)
  • the app will not be hit very often and doesn't need to be very fast, but perhaps will consume a very large amount of memory when it is run. an example would be a CMS or weblog backend that publishes to static html. the 'publish' or 'rebuild site' part probably has to do a lot of work and could use a lot of memory for a big site, but will only be run every once in a while. if you run it under mod_perl, it will bloat the apache processes and you may run into memory problems. CGI has the advantage of giving up all its memory when it's done.

those are just some of the reasons that i've deployed one way or the other in the past. others can probably come up with other reasons.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://353399]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2024-03-28 19:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found