5000 connections to backends in TIME_WAIT state, nginx grows and starts swapping

Stefan Caunter stef at caunter.ca
Tue Nov 30 23:24:20 MSK 2010


Hi,

nginx version: nginx/0.7.67
TLS SNI support enabled
configure arguments: --prefix=/usr/local/etc/nginx --with-cc-opt='-I
/usr/local/include' --with-ld-opt='-L /usr/local/lib'
--conf-path=/usr/local/etc/nginx/nginx.conf
--sbin-path=/usr/local/sbin/nginx --pid-path=/var/run/nginx.pid
--error-log-path=/var/log/nginx-error.log --user=www --group=www
--http-client-body-temp-path=/var/tmp/nginx/client_body_temp
--http-proxy-temp-path=/var/tmp/nginx/proxy_temp
--http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp
--http-log-path=/var/log/nginx-access.log
--with-http_gzip_static_module --with-http_ssl_module
--with-http_stub_status_module
--add-module=/usr/ports/www/nginx/work/nginx_upstream_fair-20090923
--add-module=/usr/ports/www/nginx/work/nginx_upstream_hash-0.3.1
--with-pcre

I have two freebsd 8.0 servers using carp, nginx listens on the carp
interface on both for high availability.

What I am seeing is that nginx opens 5,000 connections to the
preferred back end. I have a backup back end declared, but prefer one.
This causes nginx to grow in size, use a lot of swap, and die.

I've mitigated this by setting net.inet.tcp.keepidle=300000 on
freebsd. The connections go away after 5 minutes.

It's a pretty simple nginx.conf I use, and I'm not sure why I'm
getting this behaviour. Should I simply upgrade my nginx to latest?

Thoughts appreciated.


---


Stefan Caunter
cell: 416 561 4871
Skype: stefan.caunter



More information about the nginx mailing list