Apache performing Graceful restarts (11.30.6.3)

accretor

Member
Feb 3, 2012
18
0
51
cPanel Access Level
Root Administrator
I'll appreciate any help from cPanel reps or other users. Any info on this will be appreciated! What's going on, what symptoms might it cause in our service, and how do I fix it?

Code:
grep Graceful restart requested, doing restart /usr/local/apache/logs/error_log

/usr/local/apache/logs/error_log:[Fri Mar 02 01:15:23 2012] [notice] Graceful restart requested, doing restart
/usr/local/apache/logs/error_log:[Fri Mar 02 03:12:10 2012] [notice] Graceful restart requested, doing restart
/usr/local/apache/logs/error_log:[Fri Mar 02 04:10:55 2012] [notice] Graceful restart requested, doing restart
/usr/local/apache/logs/error_log:[Fri Mar 02 05:09:18 2012] [notice] Graceful restart requested, doing restart
/usr/local/apache/logs/error_log:[Fri Mar 02 07:06:06 2012] [notice] Graceful restart requested, doing restart
/usr/local/apache/logs/error_log:[Fri Mar 02 09:02:54 2012] [notice] Graceful restart requested, doing restart
/usr/local/apache/logs/error_log:[Fri Mar 02 10:59:40 2012] [notice] Graceful restart requested, doing restart
/usr/local/apache/logs/error_log:[Fri Mar 02 13:13:09 2012] [notice] Graceful restart requested, doing restart
/usr/local/apache/logs/error_log:[Fri Mar 02 15:09:55 2012] [notice] Graceful restart requested, doing restart
/usr/local/apache/logs/error_log:[Fri Mar 02 17:06:42 2012] [notice] Graceful restart requested, doing restart
Here is the detail from one of the log entries.

I realize there are a number of warnings about our Apache configuration. What I can say is it does work, so I haven't really looked into these. I'll have to try to find time to do that. However, my primary concern is that I don't like all these Apache restarts. There's nothing in the log before the restart notice, so I don't know why they're occurring.

Where I thought it important to obfuscate information that I don't wish to disseminate publicly, I have replaced the text with ◆ symbols.

Code:
[Fri Mar 02 17:06:42 2012] [notice] Graceful restart requested, doing restart
[Fri Mar 02 17:06:42 2012] [warn] RSA server certificate wildcard CommonName (CN) `*.sustainablylush.ca' does NOT match server name!?
[Fri Mar 02 17:06:42 2012] [warn] Init: SSL server IP/port conflict: ◆◆◆◆◆◆◆.sustainablylush.ca:443 (/usr/local/apache/conf/httpd.conf:861) vs. sustainablylush.ca:443 (/usr/local/apache/conf/includes/post_virtualhost_global.conf:2)
[Fri Mar 02 17:06:42 2012] [warn] Init: You should not use name-based virtual hosts in conjunction with SSL!!
[Fri Mar 02 17:06:42 2012] [notice] mod_bw : Memory Allocated 0 bytes (each conf takes 48 bytes)
[Fri Mar 02 17:06:42 2012] [notice] mod_bw : Version 0.92 - Initialized [0 Confs]
[Fri Mar 02 17:06:42 2012] [notice] Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 configured -- resuming normal operations
I found some posts on this forum about 11.25 and an issue much like this one. However, all it really said is that it was going to be fixed by an update. That was nearly 3 years ago, so I'm guessing we're having a different issue.

The cPanel/WHM version is 11.30.6 build 3.
 

Brian

Well-Known Member
Dec 1, 2010
117
3
68
Texas
cPanel Access Level
Root Administrator
Apache Graceful restarts are a normal and intended part of a cPanel & WHM server.

cpanellogd (the daemon that processes bandwidth and web statistics (awstats/analog/logaholic/webalizer)) requires that Apache be restarted whenever it goes to process logs. This is due to the fact that, once logs are properly processed out, Apache must restart to re-open file handles on each domain's log. Failure to do this would mean you wouldn't get any bandwidth or stats reporting (breaking monthly bandwidth limits among others).

By default, web stats are calculated every 2 hours and bandwidth every 24 hours. This means every 2 hours (and every 24 hours) Apache will gracefully restart. Again, normal and intended. You can modify these intervals via "WHM -> Statistics Software Configuration" if you like.

If you notice, most of your log shows 2 hour interval restarts -- perfectly aligning with my explanation.

Beyond that, Apache will restart anytime a user on the system performs an action that modifies httpd.conf. This is required to read in the changes made. This includes creating a new cPanel user, adding or removing an addon/parked/subdomain, etc. That would account for the restarts in between that 2 hour interval.

If you would like to reduce the amount of graceful restarts that occur, you can explore turning on the "Piped Logging" option for Apache.

Piped Log Configuration

This pipes access logs to a separate process, thereby removing the need for Apache to restart for processing bandwidth and stats. However, Apache will still require restarts anytime httpd.conf is changed by an action taken through WHM/cPanel (adding/removing domains, etc.).

Note that a graceful restart induces fractions of a second to just a few seconds downtime at the most.
 

dmacleo

Active Member
Jan 28, 2012
44
0
56
cPanel Access Level
Root Administrator
does using piped have any downsides?
the restarts do cause a touch of slowdowns for me (cache stuff on software I use) and it is extremely brief.
but if using piped has no bad side to it its worth it to me.
thanks.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Piped logging might have a slightly higher memory usage, since it's going to have a process constantly running to pipe the logs. You could always switch back if you find piped logging isn't working out better for you.