Apache Graceful Restart Requested Every Two Hours

by Liz on Aug 14, 2010

Today I inspected the Apache error log, …/apache/logs/error, on my Virtual Private Server (VPS) server at LiquidWeb and noted that Apache was being restarted every 2 hours.

The restart notices were appearing in the log 12 times a day along with any other scheduled or manual restarts. This is an excerpt of yesterday’s error log.

# grep 'Aug 13' /usr/local/apache/logs/error_log | grep 'Graceful'
[Fri Aug 13 01:12:46 2010] [notice] Graceful restart requested, doing restart
[Fri Aug 13 03:10:53 2010] [notice] Graceful restart requested, doing restart
[Fri Aug 13 05:08:28 2010] [notice] Graceful restart requested, doing restart
[Fri Aug 13 07:05:49 2010] [notice] Graceful restart requested, doing restart
[Fri Aug 13 08:05:13 2010] [notice] Graceful restart requested, doing restart
[Fri Aug 13 09:11:05 2010] [notice] Graceful restart requested, doing restart
[Fri Aug 13 11:08:16 2010] [notice] Graceful restart requested, doing restart
[Fri Aug 13 13:05:19 2010] [notice] Graceful restart requested, doing restart
[Fri Aug 13 15:02:23 2010] [notice] Graceful restart requested, doing restart
[Fri Aug 13 17:16:05 2010] [notice] Graceful restart requested, doing restart
[Fri Aug 13 19:13:09 2010] [notice] Graceful restart requested, doing restart
[Fri Aug 13 21:10:11 2010] [notice] Graceful restart requested, doing restart
[Fri Aug 13 23:07:14 2010] [notice] Graceful restart requested, doing restart

I logged a ticket with my hosting provider, LiquidWeb.

In just a few minutes they were able to come up with a solution by configuring Apache to use Piped Logs.

Apache httpd is capable of writing error logs and access logs through a pipe to another process, rather than directly to files. This feature increases the flexibility of logging without having to any any modules into the core Apache code. It also has the side effect of inhibiting the graceful restarts.

This is what is the Apache Configuration looks like in the WHM Panel once you have followed the navigation path:

Main >> Service Configuration >> Apache Configuration >> Piped Log Configuration

At well as stopping the frequent restarts this solution also has the benefit of reducing the amount of memory consumed by Apache.

UA-160742-16