Opened 8 years ago

Closed 8 years ago

#856 closed defect (invalid)

Reload Nginx configuration file will cause Nginx can't work on Solaris11

Reported by: minjing@… Owned by:
Priority: major Milestone:
Component: nginx-core Version: 1.8.x
Keywords: Cc:
uname -a: SunOS stageip1 5.11 11.2 sun4v sparc SUNW,T5240
nginx -V: nginx version: nginx/1.8.0
built by Sun C 5.10 SunOS_sparc 2009/06/03
built with OpenSSL 0.9.8y 5 Feb 2013
TLS SNI support enabled
configure arguments: --user=iris --prefix=/uadev/BIAreference/3rdParty/NGINX/V1.8.0.1/sparc/opt/local --with-cpu-opt=sparc64 --with-ipv6 --with-http_ssl_module --with-http_realip_module --with-http_stub_status_module --with-http_sub_module --with-http_flv_module --with-http_gzip_static_module --with-select_module --with-ld-opt=-L/uadev/BIAreference/3rdParty/NGINX/V1.8.0.1/sparc/opt/local/lib --with-cc-opt='-I /uadev/BIAreference/3rdParty/NGINX/V1.8.0.1/sparc/opt/local/include' --with-pcre=../pcre-8.32

Description

  1. List "nginx" working process:

...

15866 ? S 0:00 nginx: worker process
15867 ? S 0:00 nginx: worker process
15868 ? S 0:00 nginx: worker process
15869 ? S 0:00 nginx: worker process
27511 ? S 0:04 nginx: master process

  1. Using command "sudo sbin/nginx -p . -s reload" to reload nginx configuration file
  1. List "nginx" working process:

27511 ? S 0:03 nginx: master process

All nginx worker process is disappeared only master process exist, at this time I can't access the delegated web site through nginx, the browser is always loading and then timed out.
I have to re-run "sudo sbin/nginx -p . -s reload" and then all nginx worker process will back, and the delegated web site can be access.

Is it my build options problem or it is the bug exist in Nginx? Can anyone help me?

Change History (4)

comment:1 by Maxim Dounin, 8 years ago

Please try looking into error log, it may have some relevant information.

comment:2 by minjing@…, 8 years ago

I saw the error log complain may "Too many open files" warning when I execute reload configuration and all nginx workers are disappeared:
=====
2015/12/13 19:50:02 [alert] 1919#0: socketpair() failed while spawning "worker process" (24: Too many open files)
2015/12/13 19:50:02 [alert] 1919#0: socketpair() failed while spawning "worker process" (24: Too many open files)
2015/12/13 19:50:02 [alert] 1919#0: socketpair() failed while spawning "worker process" (24: Too many open files
...
======

comment:3 by minjing@…, 8 years ago

When I do execute reload configuration again then no such warning appear in error.log, all nginx workers are back, the nginx service also back to normal, strange.

comment:4 by Maxim Dounin, 8 years ago

Resolution: invalid
Status: newclosed

Reload process is expected to cause additional resource usage. In particular, nginx opens additional sockets to new worker processes it spawns - while sockets to old worker processes are not yet closed. In your case system limits prevent nginx from starting new worker processes due to this excessive resource usage, and that's what causes effects observed. Tune your system limits to allow nginx to open more files, it should fix the problem.

Note: See TracTickets for help on using tickets.