sudo /etc/init.d/apache2 reload

interrupting the operations on the webservers hosted by apache ?


Reload does a "Graceful Restart".

From the Apache documentation Stopping and Restarting :

The USR1 or graceful signal causes the parent process to advise the children to exit after their current request (or to exit immediately if they're not serving anything). The parent re-reads its configuration files and re-opens its log files. As each child dies off the parent replaces it with a child from the new generation of the configuration, which begins serving new requests immediately.

In theory no operations will be interrupted, but there will be a wave of server-processes restarting, with some (normally trivial enough) overhead.

In effect there are more variables involved, such as whether you are using prefork or worker, the number of children that you have specified, and in the case of worker the max threads per child.

  • 1
    ok. So, more precisely, if my customer is performing an order on a php based e-shop. If i reload apache without restarting, is he going to have issues ? thanks – aneuryzm Sep 26 '10 at 7:59
  • Again in theory, as long as the customer order is handled in one php call, and as long as the reload is not critical for the correct functioning of "old generation" servers, then all will pass gracefully and well. But it's easy enough to test in practice. – harrymc Sep 26 '10 at 8:25
  • Note that the init scripts are added by the packager. The ones for redhat/oracle linux apache v2.2 send a -HUP signal when calling service httpd reload. For a graceful restart service httpd graceful should be called which calls /usr/sbin/apachectl graceful. – David Balažic Jul 28 '14 at 17:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.