Apache restart != graceful

While chatting with a friend last week, he mentioned that he uses the apachectl restart option to get Apache to reread configuration files. This works, but it forcefully terminates all children (even ones processing requests), and can lead to user sessions getting blotched. As of Apache 1.3, you can now use the apachectl graceful option to gracefully restart a web server:

$ apachectl graceful

This utilizes the generation values in the Apache scoreboard, and allows each child to die once they complete the request processing loop. If you are interested in seeing how this is done, check out prefork.c in the Apache source code.

This article was posted by Matty on 2006-02-25 11:17:00 -0400 -0400