Hiya. I', using Gentoo linux. it seems that i cannot emerge/install mod_perl with a threaded apache2 so i would like to know what's the pros and cons of using the worker module of apache2 with cgi-perl and using the prefork module of apache2 with mod_perl

what's faster? what takes less resources? security wise, is there any difference?

thanks!

link|improve this question

71% accept rate
feedback

3 Answers

up vote 1 down vote accepted

On Linux, use prefork apache w/ mod_perl. The Threaded MPM is a huge win for Win32 users, where process creation is expensive. On linux fork() is a pretty cheap call. However Mod_perl2 devs have gone through great effort to make mod_perl2 work with apache2 + threads, but the thread model in perl is a bit memory-intensive.

We develop a big mod_perl app, and if we had to recreate it today, I'd probably recommend one of the various frameworks and use FastCGI or PSGI. Using FCGI or a frame work with native PSGI/FCGI capabilities lets you have your choice of front-ends (nginx, lighttpd, apache2). You can chroot your app and lower it's privledges (it only needs a socket to talk to your front end). If you make your app use mod_perl2, your pretty much married to Apache2.

link|improve this answer
feedback

IMHO, prefork+mod_per would be much faster, but asking in mod_perl mailing list would give you more exact answer

link|improve this answer
feedback

Just some additional info, we just dumped mod_perl on Win32 and switched to PSGI using Plack. There's a compatibility layer for CGI::Application that's working very nicely for us. Catalyst is switching/has switched to PSGI as well.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.