[sf-perl] All these Perl web frameworks

Fred Moyer fred at redhotpenguin.com
Wed Aug 8 07:47:36 PDT 2012

On Tue, Aug 7, 2012 at 2:40 PM, Bryan Beeley <bryan at beeley.org> wrote:
> At work we actually still use mod_perl in Apache 2 (gasp!), simply because
> we have optimized its performance enough that switching hasn't seemed worth
> the effort.  Our Apache instance is sitting behind nginx, so there is also
> that.

mod_perl is used by many companies despite that it has been around for
over 10 years. The mod_perl users list is very active right now, and 2
new releases have come out this year. It's a good platform for serving
large web applications; Apache is widely used, so you get the benefit
of performance optimizations, a web server with a history of solid
security, and a large development team. It isn't vulnerable to a bus
taking out one developer, or the more common situation of the lone
developer moving on to something else.

If your application runs on more than one machine, you'd be hard
pressed to find a better web server than mod_perl. As long as you have
an http connection pooler like nginx (Perlbal is my preferred choice)
in front of the application servers, scaling it is not a problem.

> The general idea with copy-on-write is that you want to find the place in
> the framework you are using where it forks, and make sure you load
> everything before that gets called.  For Moose-based code this means you
> want to explicitly use modules rather than letting Moose load them for you
> automatically.  For DBIx::Class based code it helps to instantiate your
> schema so that all the result, result source, and result set classes are
> loaded.  In applications that have a lot of static lookup tables in the
> database, you might want to load all of them into memory (make sure
> DBIx::Class::Cursor::Cached cursors get loaded, etc).  We pre-load all the
> Template Toolkit templates into memory by reaching into Catalyst, pulling
> out a template object, and manually calling
> $template_ob->process($template_file, {}, \$output) for all template files.
> If I had to guess about FCGI, assuming you are using FCGI::ProcManager, I
> would say load everything that you want to be in COW memory before pm_manage
> was called.  It seems like you would do something similar with
> Starlet/Parallel::Prefork.  This is just a guess though.
> For Apache+mod_perl you specify a PerlPostConfigRequire script to do all
> your initialization.
> For Starman there is a --preload-app option or the -M option.
> Bryan
> _______________________________________________
> SanFrancisco-pm mailing list
> SanFrancisco-pm at pm.org
> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm

More information about the SanFrancisco-pm mailing list