Welcome! Log In Create A New Profile

Advanced

Re: Best practices for running Perl?

Maxim Dounin
April 30, 2009 04:09PM
Hello!

On Thu, Apr 30, 2009 at 11:46:47AM -0700, Mark Aiken wrote:

> Hello,
>
> My apologies for the newbie question; I have poked around quite a bit
> and can't find a definitive answer.
>
> I'm planning to use nginx to set up a lightweight server on a slim
> virtual-slice host where resources are at a premium. The server will
> mainly just relay data from clients to back-end systems, so I don't
> need a fancy render layer or persistence model. I'm planning to go
> with Perl for its stability and light footprint.
>
> My question is, what is the current best-practice for running Perl
> behind nginx? Is the built-in Perl module stable enough to consider
> using in production or should I stick with a hand-rolled FCGI wrapper?

Embedded perl in nginx is NOT for general purpose programming. It
runs in nginx worker processes and it MUST NOT block (or all your
connections in the same nginx worker will be blocked as well) -
and this generally means you can't use DBI, anything that resolves
hostnames and so on.

It was designed to do small things that can't be easily done with
nginx itself - e.g. map some variable to another complex one -
and it does this well enough. But don't try to use it for general
purpose web programming.

Use either fastcgi or http backends if you need something general.

Maxim Dounin

> If someone feels that there would be a better slim-language choice
> that is better supported by nginx instead of Perl, I would appreciate
> hearing about that as an alternative.
>
> Cheers,
>
> Mark
>
Subject Author Posted

Best practices for running Perl?

Mark Aiken April 30, 2009 02:46PM

Re: Best practices for running Perl?

Chris Cortese April 30, 2009 02:51PM

Re: Best practices for running Perl?

Chris Cortese April 30, 2009 02:54PM

Re: Best practices for running Perl?

Mark Aiken April 30, 2009 03:06PM

Re: Best practices for running Perl?

Gabriel Ramuglia April 30, 2009 03:08PM

Re: Best practices for running Perl?

Mark Aiken April 30, 2009 03:38PM

Re: Best practices for running Perl?

Jim Ohlstein April 30, 2009 04:15PM

Re: Best practices for running Perl?

Gabriel Ramuglia April 30, 2009 04:22PM

Re: Best practices for running Perl?

Jonathan Vanasco April 30, 2009 04:49PM

Re: Best practices for running Perl?

Chris Cortese April 30, 2009 05:01PM

Re: Best practices for running Perl?

luben karavelov May 01, 2009 08:25PM

Re: Best practices for running Perl?

Maxim Dounin April 30, 2009 04:09PM

Re: Best practices for running Perl?

Mark Aiken April 30, 2009 04:21PM

Re: Best practices for running Perl?

mike April 30, 2009 04:05PM

Re: Best practices for running Perl?

luben karavelov May 01, 2009 08:43PM

Re: Best practices for running Perl?

mike May 01, 2009 09:17PM

Re: Best practices for running Perl?

luben karavelov May 01, 2009 10:10PM

Re: Best practices for running Perl?

mike May 01, 2009 11:52PM

Re: Best practices for running Perl?

luben karavelov May 02, 2009 10:48AM

Re: Best practices for running Perl?

luben karavelov May 02, 2009 10:40AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 216
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready