4 ms·
When you run `/etc/init.d/nginx reload` I was under this impression this is zero-downtime. Is that not true then?
by nodesocket 12y ago
When you run `/etc/init.d/nginx reload` I was under this impression this is zero-downtime. Is that not true then?
- fideloper 12y agoCorrect - article explains what HAProxy reload does behind the scenes and how it can drop connections for a very short period (many if you have many connections like yelp does!)
- fweespeech 12y agoIf you truly meant Nginx and not HAProxy, Nginx does its best to avoid dropping connections on a reload: http://nginx.org/en/docs/control.html http://nginx.org/en/docs/control.html > 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. It brings up the new worker processes to handle new connections and wait for the existing connections to terminate. Key phrase is "does its best", I've seen edge cases that aren't really Nginx's fault that cause connections to be dropped. [e.g. OOM issues when it tries to bring up new workers]