What happens to new connections during nginx reload

When nginx reloads, The master process first checks the syntax validity, then tries to apply new configuration. If this succeeds, it starts new worker processes, and sends messages to old worker processes requesting them to shut down gracefully.

When does the master process send shutdown message to old worker processes - is it in parallel to creating new worker processes or only after new worker processes are up?

Want to understand if nginx reload takes longer duration, for the reload duration will it be able to handle new connections?


This is from the nginx docs:

In order for nginx to re-read the configuration file, a HUP signal should be sent to the master process. The master process first checks the syntax validity, then tries to apply new configuration, that is, to open log files and new listen sockets. If this fails, it rolls back changes and continues to work with old configuration. If this succeeds, it starts new worker processes, and sends messages to old worker processes requesting them to shut down gracefully. Old worker processes close listen sockets and continue to service old clients. After all clients are serviced, old worker processes are shut down.

One old worker process is being kept alive to serve connections. The old worker is shut down if the new workers could be started. Otherwise nginx starts old workers again.

There is also a detailled example of the process in the docs.

Hope this helps!