Thursday, January 20, 2011

apache2-worker + cgi-perl vs apache2-prefork + mod_perl - what’s faster? what takes less resources?

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!

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

    From
  • 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.

    From Jason

0 comments:

Post a Comment