2

We have 4 webservers behind nginx being hit with 262 events/second. I would like to tell nginx to stop sending requests to that server. If I remove the server from the file and reload the file, aren't all requests in process dropped on the floor then as nginx no longer knows that server. What can I add to the config so it slowly drops that server out of the pool and I can wait for current requests to complete.

2 Answers 2

4

According to the nginx documentation, updating the config and then using the service nginx reload or /etc/init.d/nginx reload commands should start new worker processes with the new configuration and close any listen sockets on the old worker processes, preventing new connections to them. These old worker processes will continue running until they have finished serving their clients and then shut down.

http://nginx.org/en/docs/control.html#reconfiguration

0

Mark server as down in nginx config. You might also check max_fails and fail_timeout parameters. Reload the config by sending HUP signal to the master node.

See nginx manual

Please note that you should use QUIT signal to gracefully shutdown the server node.

2
  • manual says for down the following "marks server as permanently offline, to be used with the directive ip_hash." I am not using ip_hash directive though :(. Nov 5, 2012 at 22:22
  • Set max_fails to 1 and reload config (sig HUP). Gracefully shutdown the server node by sending QUIT signal.
    – FINESEC
    Nov 5, 2012 at 22:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .