Continues downtime due to graceful restarts.

9944990

Member
Feb 9, 2014
9
0
1
cPanel Access Level
Root Administrator
I am having continues server downtime of at 6 - 12 minutes on my new dedicated server.

After checking apache status it is not indicating any restart this means apache does not restart when mpm_prefork request it only resumes operation after this 6 to 12 minutes of time.

Here is the error log before and after restart:

Code:
[Sat Feb 08 18:03:15.422141 2014] [:error] [pid 55570] [client xxx.xxx.xxx.xx:54395] File does not exist: /home/username/public_html/forum/index.php
[Sat Feb 08 18:03:15.755244 2014] [:error] [pid 55570] [client xxx.xxx.xxx.xx:54395] File does not exist: /home/username/public_html/forum/index.php
[Sat Feb 08 18:10:01.995825 2014] [mpm_prefork:notice] [pid 33190] AH00171: Graceful restart requested, doing restart
[Sat Feb 08 18:15:44.074260 2014] [mpm_prefork:notice] [pid 33190] AH00163: Apache/2.4.7 (Unix) OpenSSL/1.0.1e-fips mod_bwlimited/1.4 configured -- resuming normal operations
[Sat Feb 08 18:15:44.074290 2014] [core:notice] [pid 33190] AH00094: Command line: '/usr/local/apache/bin/httpd -D SSL'
[Sat Feb 08 18:16:01.132928 2014] [:error] [pid 57744] [client xxx.xxx.xxx.xx:54811] File does not exist: /home/username/public_html/wp-login.php, referer: www.domain.com
[Sat Feb 08 18:16:01.133741 2014] [core:error] [pid 57744] [client xxx.xxx.xxx.xx:54811] AH00135: Invalid method in request u
[Sat Feb 08 18:16:03.145134 2014] [core:error] [pid 57813] [client xxx.xxx.xxx.xx:63792] AH00135: Invalid method in request n.ru
[Sat Feb 08 18:16:03.253939 2014] [:error] [pid 57827] [client xxx.xxx.xxx.xx:65078] File does not exist: /home/username/public_html/admin.php, referer: www.domain.com
[Sat Feb 08 18:16:03.254431 2014] [core:error] [pid 57827] [client xxx.xxx.xxx.xx:65078] AH00135: Invalid method in request w.domain.com
I think as the error logs shows mpm_prefork requests graceful restart but why it is taking so long and interrupting services? and how to avoid this?.
 

cPanelPeter

Senior Technical Analyst
Staff member
Sep 23, 2013
586
25
153
cPanel Access Level
Root Administrator
Hello,

Which version of cPanel are you running?
You can find out by typing: /usr/local/cpanel/cpanel -V

Also which PHP handler are you running?
You can find out by typing: /usr/local/cpanel/bin/rebuild_phpconf --current
 

9944990

Member
Feb 9, 2014
9
0
1
cPanel Access Level
Root Administrator
I apologize I should have provided these information with my question:

CentOS 6.5 86_64
cPanel 11.40.1 (Build 11)
Available handlers: suphp dso cgi none
DEFAULT PHP: 5
PHP4 SAPI: none
PHP5 SAPI: suphp
SUEXEC: enabled
RUID2: not installed

It is a new server build 3 days ago everything is new. I had same issue on my old server which was fixed by my hosting provided and I am not aware what they did. Even copying Apache configuration and php.ini from the old server did not solve my issue.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Hello :)

You can enable Piped Logging via:

"WHM Home » Service Configuration » Apache Configuration » Piped Log Configuration"

This will stop the automatic graceful restart of Apache from occurring every two hours.

Thank you.
 

9944990

Member
Feb 9, 2014
9
0
1
cPanel Access Level
Root Administrator
Hello,

Thank you for your help, Actually apache does not restart every 2 hours it is mpm_prefork which requests the graceful restart about 2 to 3 times in a day and apache does not preform the restart it just goes down for 6 - 12 minutes and resumes operation.

Now I enabled Piped log configuration and apache went down totally I had to reboot the server as restart apache from command line did not and WHM was not able to show apache status and below is the error logs:

Mon Feb 10 20:32:39.748458 2014] [mpm_prefork:notice] [pid 49794] AH00171: Graceful restart requested, doing restart
Code:
[Mon Feb 10 20:35:54.820257 2014] [mpm_prefork:notice] [pid 49794] AH00163: Apache/2.4.7 (Unix) OpenSSL/1.0.1e-fips mod_bwlimited/1.4 configured -- resuming normal operations
[Mon Feb 10 20:35:54.820288 2014] [core:notice] [pid 49794] AH00094: Command line: '/usr/local/apache/bin/httpd -D SSL'
[Mon Feb 10 20:36:01.391874 2014] [mpm_prefork:notice] [pid 49794] AH00171: Graceful restart requested, doing restart
[Mon Feb 10 20:41:03.078920 2014] [suexec:notice] [pid 1393] AH01232: suEXEC mechanism enabled (wrapper: /usr/local/apache/bin/suexec)
[Mon Feb 10 20:41:03.092398 2014] [core:warn] [pid 1397] AH00098: pid file /usr/local/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Mon Feb 10 20:41:03.132572 2014] [mpm_prefork:notice] [pid 1397] AH00163: Apache/2.4.7 (Unix) OpenSSL/1.0.1e-fips mod_bwlimited/1.4 configured -- resuming normal operations
[Mon Feb 10 20:41:03.132625 2014] [core:notice] [pid 1397] AH00094: Command line: '/usr/local/apache/bin/httpd -D SSL'
Now as I can see through WHM the piped Apache logs is enabled I will wait and see if the problem vanishes or not.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Feel free to open a support ticket using the link in my signature so we can take a closer look. You can post the ticket number here so we can update this thread with the outcome.

Thank you.
 

9944990

Member
Feb 9, 2014
9
0
1
cPanel Access Level
Root Administrator
Thanks, we look forward to the results.
Just wanted to update you guys and also for those who might have similar issues that my problem has been solved.

After enabling Piped Logging and applying Apache Slow Graceful Restart Patch the issue is solved. :)

Now the server is up for 3 days without any issue.

I thank every one of you for your cooperation.