Welcome! Log In Create A New Profile

Advanced

Re: fastcgi_keep_conn consuming ports?

Maxim Dounin
January 07, 2012 03:34PM
Hello!

On Fri, Jan 06, 2012 at 03:02:54PM -0800, Scott Conger wrote:

> I wanted to try the new "fastcgi_keep_conn on;" configuration
> setting. I grabbed 1.1.13 and added the setting to my
> configuration. It seems to function, but I started getting HTTP
> 502 errors when I put load on the server. Looking at netstat, it
> seems to be consuming all available ports:
>
> netstat -nt > stat.txt
> grep TIME_WAIT stat.txt | wc -l
> 49894
>
> Everything works fine if I comment the configuration line out,
> which leaves me a bit puzzled as to what is going on. Is there
> perhaps some other setting I should be changing?
>
> nginx -V
> nginx version: nginx/1.1.13
> built by gcc 4.1.2 20080704 (Red Hat 4.1.2-50)

If you want to use persistent fastcgi connections, you should use
fastcgi_keep_conn *and* keepalive directive in the upstream block,
i.e.

upstream backend {
server ...;
keepalive 5;
}

server {
...

location / {
fastcgi_pass backend;
fastcgi_keep_conn on;
...
}
}

Using fastcgi_keep_conn by itself only moves responsibility of
closing fastcgi connections from backend to nginx, and thus moves
TIME_WAIT connections from backend(s) to nginx side as well.

Maxim Dounin

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

fastcgi_keep_conn consuming ports?

Scott Conger January 07, 2012 10:36AM

Re: fastcgi_keep_conn consuming ports?

Maxim Dounin January 07, 2012 03:34PM

Re: fastcgi_keep_conn consuming ports?

locojohn January 07, 2012 06:08PM

Re: fastcgi_keep_conn consuming ports?

Maxim Dounin January 07, 2012 07:04PM

Re: fastcgi_keep_conn consuming ports?

Andrew Alexeev January 13, 2012 02:44PM

Re: fastcgi_keep_conn consuming ports?

locojohn January 13, 2012 07:13PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 309
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