When to restart and not reload Nginx?

后端 未结 3 1905
一整个雨季
一整个雨季 2021-01-31 07:38

When is it necessary to restart nginx and reload will not suffice?
Does it make a difference if an extension like passenger is used?

Should the service be restarted

3条回答
  •  余生分开走
    2021-01-31 08:05

    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.

    On the other hand when you restart nginx you might encounter situation in which nginx will stop, and won't start back again, because of syntax error.

    Reloading terminates the old process, so any memory leaks should be cleared anyway.

提交回复
热议问题