« Is there a Need for RSS Feeds from Tufts? | Main | Yearly Student Import: Doing More Work Now to Save Time Later »

August 19, 2004

What does Apache's graceful restart really do?

Once upon a time I had heard that using Apache's graceful restart in a Apache/mod_perl environment wasn't a good idea. For that reason I've avoided graceful restarts, using stop/start to ensure the webserver is down and then bring it back up. Because there would be a few seconds of downtime in the stop/start process I'd typically wait until the wee hours of the next morning.

Today I needed to restart a webserver immediately, in the middle of the day. I decided it was time to clear up the graceful rumors, just to prove one way or another.

I stumbled into some good info in the Apache docs:

USR1 Signal: graceful restart

Note: prior to release 1.2b9 this code is quite unstable and shouldn't be used at all.

The USR1 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.

I find the description poetic, prehaps because it is poetry or because it's the answer I wanted to hear.

The problems with graceful are very old, and my caution was unwarranted. I gracefully restarted the server without incidence.

Posted by mike at August 19, 2004 9:40 AM