Service availability during reload

Hello

In an apache webserver with many virtual hosts, a “reload” command can
cause a (quick) unavailability of the service while apache re-reads its
configuration files.

Does anyone have any experience with this on Nginx? Will sending it a
SIGHUP cause the main process to block and not be able to handle
connections during that instant?

Thank you,
Andre

Hello,

Sometimes reading the documentation might help :
http://nginx.org/en/docs/control.html

If you look at your service file, you’ll notice that a ‘reload’ means
sending SIGHUP to the master process for the particular case of nginx.
I’ll leave the conclusion to you, assuming that the doc is clear enough.

As a general thinking methodology, considering implicitly that other
webserver (especially modern ones with huge shifts in paradigms) behave
the
same as Apache only leads to deception…

B. R.

Hello!

On Fri, Nov 29, 2013 at 09:12:39AM -0200, Andre N. wrote:

Hello

In an apache webserver with many virtual hosts, a “reload” command can
cause a (quick) unavailability of the service while apache re-reads its
configuration files.

Does anyone have any experience with this on Nginx? Will sending it a
SIGHUP cause the main process to block and not be able to handle
connections during that instant?

Short answer:

This is not a problem with nginx.

Long answer:

Connections are handled by worker processes. On SIGHUP, master
process parses new configuration and spawns new worker processes
(while old workers still handle requests). Then it asks old
workers to gracefully shutdown. That is, all the time requests
are handled by worker processes and service is available.

Moreover, it is possible to upgrade nginx binary on the fly
without loosing any single request.

See here for more details:

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


Maxim D.
http://nginx.org/en/donation.html

On 11/29/2013 10:13 AM, Maxim D. wrote:

Connections are handled by worker processes. On SIGHUP, master
process parses new configuration and spawns new worker processes
(while old workers still handle requests). Then it asks old
workers to gracefully shutdown. That is, all the time requests
are handled by worker processes and service is available.

Thank you so much Maxim. That was the impression I had skimming through
ngx_cycle.c and ngx_process_cycle.c but since I’m not familiar with the
code, I just wanted to make sure.

Cheers,
Andre

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs