Skip to content

Instantly share code, notes, and snippets.

@keyan
Created December 18, 2015 01:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keyan/237517ff18a6a3af25fc to your computer and use it in GitHub Desktop.
Save keyan/237517ff18a6a3af25fc to your computer and use it in GitHub Desktop.
NGINX master process death while workers continue to run

Find list of processes and connections: lsof -i

Kill worker processes sudo pkill nginx

Restart nginx sudo service nginx restart

Good logs to check: /var/log/nginx/error.log /var/log/upstart/consul-template.log (side note for me, cause consul<-->nginx closely related)

@leohowell
Copy link

I met this issue too.
Master process died while workers continue running.
Do you know why this happened?

# ps -ef | grep nginx
nobody   26250     1  0 May20 ?        00:00:00 nginx: worker process
nobody   26251     1  0 May20 ?        00:00:00 nginx: worker process
nobody   26252     1  0 May20 ?        00:00:00 nginx: worker process
nobody   26253     1  0 May20 ?        00:00:00 nginx: worker process

@keyan
Copy link
Author

keyan commented Aug 25, 2016

@leohowell, there are no email notifications for gist comments so sorry I didn't see this earlier. In my case the cause was that I was applying many rapid change to my NGINX configuration and calling:

$ sudo service nginx reload

This eventually put the master process in a weird state and it died, this leave the child processes as zombies. This behavior is documented in an unresolved NGINX issue: yaoweibin/nginx_upstream_check_module#53.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment