Welcome! Log In Create A New Profile

Advanced

Re: nginx, fcgi+perl forking a new process per request ...

All files from this thread

File Name File Size   Posted by Date  
php-fastcgi 3.9 KB open | download vesperto 03/15/2010 Read message
Grzegorz Nosek
March 20, 2010 02:18PM
On sob, mar 20, 2010 at 02:37:07 +0200, Stefan Parvu wrote:
>
> Here is a short review about a simple FCGI comparation: perl/native
> on Solaris 10U8, using nginx 32bit.
>
> Thanks to gnosek for pointers about the native version.
>
> http://systemdatarecorder.org:9009/bugzilla/show_bug.cgi?id=51

Interesting. As for the large response time, you'd generally run a bunch
of fcgiwraps (e.g. by using the -c option) to improve responsiveness.
The memory cost should be negligible compared to a single instance.

Right now all the requests are processed sequentially, so if your CGI
script slept for 5 seconds, you'd get 0.2 req/sec tops plus an
absolutely abysmal response time.

Of course, this also applies to the Perl wrapper. You can implement a
simplistic prefork there by replacing:

-----------------------------
my $pid = fork();

if( $pid == 0 ) {
&main;
exit 0;
}
-----------------------------

with:

-----------------------------
for (1 .. HOWEVER_MANY_CHILDREN_YOU_WANT) {
my $pid = fork();

if( $pid == 0 ) {
&main;
exit 0;
}
}
-----------------------------

Also, if your real CGI scripts you are going to run are all Perl-based,
you may get better results by converting them to talk FastCGI directly
to save on the overhead of launching Perl and loading its modules once
per request. However, this includes some gotchas and is generally
getting way off topic :)

Best regards,
Grzegorz Nosek

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

nginx, fcgi+perl forking a new process per request ...

Stefan Parvu March 15, 2010 08:18AM

Re: nginx, fcgi+perl forking a new process per request ...

Maxim Dounin March 15, 2010 08:32AM

Re: nginx, fcgi+perl forking a new process per request ...

Stefan Parvu March 15, 2010 08:46AM

Re: nginx, fcgi+perl forking a new process per request ... Attachments

vesperto March 15, 2010 12:30PM

Re: nginx, fcgi+perl forking a new process per request ...

Stefan Parvu March 15, 2010 12:42PM

Re: nginx, fcgi+perl forking a new process per request ...

Roger Hoover March 15, 2010 12:54PM

Re: nginx, fcgi+perl forking a new process per request ...

Stefan Parvu March 15, 2010 03:36PM

Re: nginx, fcgi+perl forking a new process per request ...

Grzegorz Nosek March 15, 2010 04:20PM

Re: nginx, fcgi+perl forking a new process per request ...

Stefan Parvu March 15, 2010 05:14PM

Re: nginx, fcgi+perl forking a new process per request ...

Stefan Parvu March 20, 2010 08:42AM

Re: nginx, fcgi+perl forking a new process per request ...

Grzegorz Nosek March 20, 2010 02:18PM

Re: nginx, fcgi+perl forking a new process per request ...

Stefan Parvu March 21, 2010 08:16AM

Re: nginx, fcgi+perl forking a new process per request ...

Marcin Gryszkalis March 16, 2010 06:00AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 203
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready