Graceful backend shutdown

Maxim Dounin mdounin at mdounin.ru
Mon Oct 7 11:12:44 UTC 2013


Hello!

On Mon, Oct 07, 2013 at 10:08:48AM +0200, Aivaras La wrote:

> Hi all!
> 
>  I'm using Nginx as a reverse proxy and loadbalancer with 2 backends.
> Sometimes I need to turn off one of the apps server. And I need to do it
> gracefully, that when I comment one server in Nginx config, Nginx master
> process starts to send new requests to new server, but old requests and
> sessions stay in old server. I tried to use down, but it loses sessions.
> Then tried use kill -HUP, but Nginx immediately loads new config and
> closes old sessions and redirects them to new server. Thanks for help.

On kill -HUP nginx does a gracefull shutdown of old worker 
processes.  That is, all requests being handled by old worker 
processes are continue to work till they are complete.  No 
requests are lost and/or unexpectedly terminated.  Details on 
reconfiguration process can be found here:

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

-- 
Maxim Dounin
http://nginx.org/en/donation.html



More information about the nginx mailing list