+4 votes
in General IT Tips by (71.8k points)

My Apache error_log file is full of the following messages. Why is the Apache server doing graceful restart so often?

[Sun Jun 07 00:00:01.830361 2020] [mpm_event:notice] [pid 3784:tid 140104177980544] AH00489: Apache/2.4.38 (Debian) mod_fcgid/2.3.9 OpenSSL/1.1.1d configured -- resuming normal operations

[Sun Jun 07 00:00:01.830425 2020] [core:notice] [pid 3784:tid 140104177980544] AH00094: Command line: '/usr/sbin/apache2'

[Mon Jun 08 00:00:01.670530 2020] [mpm_event:notice] [pid 3784:tid 140104177980544] AH00493: SIGUSR1 received.  Doing graceful restart

[Mon Jun 08 00:00:01.738593 2020] [mpm_event:notice] [pid 3784:tid 140104177980544] AH00489: Apache/2.4.38 (Debian) mod_fcgid/2.3.9 OpenSSL/1.1.1d configured -- resuming normal operations

[Mon Jun 08 00:00:01.738617 2020] [core:notice] [pid 3784:tid 140104177980544] AH00094: Command line: '/usr/sbin/apache2'

1 Answer

+1 vote
by (348k points)
selected by
 
Best answer

From Apache's website:
Signal: USR1 (SIGUSR1) is a graceful restart. It 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.

Check the logrotate file of Apache: /etc/logrotate.d/apache2

It may be possible that logrotate settings are causing the graceful restart of Apache. But I do not think it should a concern for you because Apache will not drop any user request because of log rotation. You can change the frequency of log rotation from daily to weekly in order to prevent graceful restart happening so often.


...