Apache HTTPD 重新加载

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/671667/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 17:24:11  来源:igfitidea点击:

Apache HTTPD reload

reloadapache

提问by Luke

Does anyone know if while Apache HTTPD is doing a reload (which, let's say, takes five seconds) can it still serve requests during that time?

有谁知道在 Apache HTTPD 进行重新加载时(假设需要 5 秒)它是否仍然可以在此期间处理请求?

回答by karim79

First of all, you say reload, but assuming you mean 'reload' OR 'restart':

首先,您说重新加载,但假设您的意思是“重新加载”或“重新启动”:

   /my/path/to/httpd restart
  • Causes the current httpd process to exit, which means for a time the server appears to be down, as in not serving any requests.
  • 导致当前的 httpd 进程退出,这意味着有一段时间服务器似乎已关闭,因为没有提供任何请求。

Reload on the other side:

在另一边重新加载:

    /my/path/to/httpd reload
  • Does not cause the current server to exit, which means connections are never refused and thus the server never looks down (but is rather slow for a little while)
  • Will cause all long running httpd daemon requests to exit
  • 不会导致当前服务器退出,这意味着连接永远不会被拒绝,因此服务器永远不会向下看(但有一段时间相当慢)
  • 将导致所有长时间运行的 httpd 守护进程请求退出

回答by Ross

As far as I know, no. However there is a graceful restart which stops child nodes halting mid-request which I think takes care of this.

据我所知,没有。然而,有一个优雅的重启可以阻止子节点停止中间请求,我认为这可以解决这个问题。

http://httpd.apache.org/docs/2.2/stopping.html

http://httpd.apache.org/docs/2.2/stopping.html