Opened 12 years ago

Closed 12 years ago

#74 closed defect (worksforme)

After many config reloads the nginx process dies

Reported by: www.google.com/accounts/o8/id?id=AItOawlxiA7V7ivbFGXxrlYFswceyv7zCOKYvJs Owned by: somebody
Priority: minor Milestone:
Component: nginx-core Version: 1.1.x
Keywords: Cc:
uname -a: Linux drone 3.0.6-gentoo-cxl-kvm #1 SMP Mon Dec 12 20:04:54 UTC 2011 x86_64 QEMU Virtual CPU version 0.12.3 GenuineIntel GNU/Linux
nginx -V: ginx version: nginx/1.1.12
TLS SNI support enabled
configure arguments: --prefix=/usr --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error_log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --user=nginx --group=nginx --with-cc-opt=-I/usr/include --with-ld-opt=-L/usr/lib --http-log-path=/var/log/nginx/access_log --http-client-body-temp-path=/var/tmp/nginx/client --http-proxy-temp-path=/var/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi --http-scgi-temp-path=/var/tmp/nginx/scgi --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --with-file-aio --with-aio_module --with-ipv6 --with-pcre --with-http_addition_module --with-http_flv_module --with-http_geoip_module --with-http_perl_module --with-http_realip_module --with-http_stub_status_module --with-http_realip_module --add-module=/var/tmp/portage/www-servers/nginx-1.1.12-r1/work/agentzh-headers-more-nginx-module-137855d --add-module=/var/tmp/portage/www-servers/nginx-1.1.12-r1/work/nginx_http_push_module-0.692 --add-module=/var/tmp/portage/www-servers/nginx-1.1.12-r1/work/ngx_cache_purge-1.5 --with-http_ssl_module --without-mail_imap_module --without-mail_pop3_module --without-mail_smtp_module

Description

After a certain number of reloads are triggered via kill -HUP the nginx process dies due to too many open files.

2011/12/28 13:46:48 [emerg] 26929#0: epoll_create() failed (24: Too many open files)
2011/12/28 13:46:48 [notice] 2153#0: start worker process 26930
2011/12/28 13:46:48 [alert] 2153#0: socketpair() failed while spawning "worker process" (24: Too many open files)
2011/12/28 13:46:48 [alert] 2153#0: socketpair() failed while spawning "cache manager process" (24: Too many open files)
2011/12/28 13:46:48 [alert] 2153#0: socketpair() failed while spawning "cache loader process" (24: Too many open files)

To reproduce:

while true; do kill -HUP `cat /var/run/nginx.pid`; [ $? -ne 0 ] && break;  done

Change History (1)

comment:1 by Maxim Dounin, 12 years ago

Resolution: worksforme
Status: newclosed

1) Please make sure you wait enough time between reloads to allow old worker processes to terminate. This may take some time depending on your load pattern as worker processes are only terminated after they finish processing of already started requests. Sending HUP faster than worker processes terminate is expected to cause resource exhaustion.

2) If the above doesn't explain observed behaviour, than this is likely some socket/file leak in the master process, though there is no leaks observed here. I suspect the problem is due to third party modules compiled in (in particular - push module). Please reopen the ticket if you are able to reproduce the problem without third party modules.

Note: See TracTickets for help on using tickets.