Best practices for running Perl?

Jim Ohlstein nginx-forum at
Fri May 1 00:15:09 MSD 2009

Mark Aiken Wrote:
> Let me ask a more focused question, since we don't
> really need to use
> the nginx list to debate web languages.
>  1 - Is the nginx built-in Perl module ready for
> production use? Has
> anyone here used it in a production environment?


Known Problems

This module is experimental; therefore anything is possible and bugs are likely.

   1. It's possible for Nginx to leak memory if you reload the configuration file (via 'kill -HUP ').
   2. If a Perl module performs protracted operation, (for example DNS lookups, database queries, etc), then the process that is running the Perl script is completely tied up for the duration of script. Therefore embedded Perl scripts should be extremely careful to limit themselves to short, predictable operations.
   3. Nginx may laugh at your Perl code and hit on your girlfriend.

>  2 - If not, what is the current best practice for
> running Perl behind
> nginx in production?

I would use fcgiwrap which seems to work well in most situations. See

>  3 - What is the current best practice for running
> PHP behind nginx in
> production? Is this better than the answer for
> Perl?

That's a question of religion. Some people insist on proxy to Apache with mod_php. Others prefer fastcgi using fastcgi_pass directive.

How you start php-cgi is also a matter of religion. Some use spawn-fcgi, some use php-fpm, some use the nifty init script at

I use fastcgi and php-fpm. See There is a patch for php 5.2.9 at

Better than Perl? Depends what you are doing with it I suppose. From the little that you describe I would likely prefer php.
> Thanks!
> Mark
> On Thu, Apr 30, 2009 at 12:08 PM, Gabriel Ramuglia
>  wrote:
> > I would consider php more lightweight than perl
> in general, even
> > though perl is a good option for various logfile
> and other
> > text-processing related tasks
> >
> > On Thu, Apr 30, 2009 at 11:54 AM, Chris Cortese
> >  wrote:
> >> in reading more closely, scratch Ruby... but I
> still would consider PHP
> >> before Perl...
> >>
> >> Chris Cortese wrote:
> >>>
> >>> IMHO starting with Perl...

Posted at Nginx Forum:,1586,1593#msg-1593

More information about the nginx mailing list