mod_perl vs mod_fastcgi

gvkv picture gvkv · Dec 20, 2008 · Viewed 8.8k times · Source

I'm developing a web app in Perl with some C as necessary for some heavy duty number crunching. The main problem I'm having so far is trying to decide if I should use mod-perl, mod-fastcgi or both to run my scripts because I'm having a difficult time trying to analyze the pros and cons of each mod.

Can anyone post a summary or give a link where I can find some comparison information and perhaps some recommendations with examples?

Answer

Vinko Vrsalovic picture Vinko Vrsalovic · Dec 20, 2008

They are quite different beasts.

mod_fastcgi (by the way, mod_fcgid is recommended) just supports the FCGI protocol to execute CGIs faster with some knobs to control how many processes will it run simutaneously and not much more.

mod_perl, on the other hand is a platform for development of applications that exposes most Apache internals to you so you can tweak every webserver knob from your code, accelerates CGIs, and much more.

If all you wish is to run your CGIs quickly, and want to support as many hosts as possible, you should stick with supporting those two ways to run your code and probably standard CGI as well.

If you care about maximum efficiency at the cost of flexibility, you could aim for a single platform, probably mod_perl.

But probably the sanest option is to run everywhere and use a framework to build the application that'll take care of using the advantages of a particular way of executing if present, like Catalyst.