refer to nginx official docs . the reload command of nginx is for reload of configuration files ,and during the progress , there's no downtime of the service .
i've learned that it wait requests that already connected until it finished ,and stop accept any new request . the idea is cool , but how does it deal with the keep-live connections ? because those long-live connections won't close and there continuous request comes along .
Reloading in the panel (VPS and Dedicated Servers) Wait 5 minutes for it to rebuild the configuration file.
Reloading nginx is safer than restarting because before old process will be terminated, new configuration file is parsed and whole process is aborted if there are any problems with it.
nginx -t will test the syntax of the configuration files and ensure that all configuration files referenced are accessible. If the Nginx configuration passes testing, then Nginx will be reloaded with nginx -s reload .
You need to reload or restart Nginx whenever you make changes to its configuration. The reload command loads the new configuration, starts new worker processes with the new configuration, and gracefully shuts down old worker processes.
Here's the summary:
http://nginx.org/en/docs/control.html
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.
That means it would keep older processes handling unclosed connections while having new processes working according to the updated configuration. From this perspective connections with keep-alive are no different from other unclosed connections.
In versions prior to 1.11.11 such "old" processes could hang indefinitely long (according to @Alexey, haven't checked it though), from 1.11.11 there’s a configuration setting controlling this http://nginx.org/en/docs/ngx_core_module.html#worker_shutdown_timeout
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With