Service availability during reload

Maxim Dounin mdounin at
Fri Nov 29 12:13:17 UTC 2013


On Fri, Nov 29, 2013 at 09:12:39AM -0200, Andre Nathan 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:

Maxim Dounin

More information about the nginx mailing list