Welcome! Log In Create A New Profile

Advanced

Re: Graceful backend shutdown

Aivaras La
October 08, 2013 04:34AM
Maxim Dounin wrote in post #1123727:
> 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

I'll try to explain my example:
In my config I have upstream with 1 backend, then I change that 1
backend server IP address ( I put something I don't need (just for
example) like local news page). Then I try to access Nginx (with old
config) which starts to load my big page. When page is loading I did HUP
signal and then my page wasn't completed. New workers spawned and old
workers quitted at the same second. Nobody was waiting. Is there a
possibility that old workers wait much longer? Or somehow to change
backend servers with serving old sessions? Thanks for help!

--
Posted via http://www.ruby-forum.com/.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Graceful backend shutdown

Aivaras La October 07, 2013 04:10AM

Re: Graceful backend shutdown

Maxim Dounin October 07, 2013 07:14AM

Re: Graceful backend shutdown

Aivaras La October 08, 2013 04:34AM

Re: Graceful backend shutdown

Maxim Dounin October 08, 2013 08:40AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 313
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready