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:
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)
On Fri, Jan 06, 2012 at 03:02:54PM -0800, Scott Conger wrote:
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.
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.