Score:1

What happens to new connections during nginx reload

us flag

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?

Score:2
mx flag

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!

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.