HTTPD Keep Restarting Every 10 Minutes

mesranet

Well-Known Member
May 6, 2002
133
0
316
Hmm.....

Situation: Peak Hours

Before SIGUSR1:
Load Average = 3.00 2.83 3.51

After SIGUSR1:
Load Average = 47.00 30.00 29.00

Time to back to normal - 3.00 = 5 minute

How long the server is in normal situation ? 5 minute crash and 5 minute normal .. isnt it ? Think about it!
 

andyf

Well-Known Member
Jan 7, 2002
249
0
316
UK
[quote:ee5f65577e][i:ee5f65577e]Originally posted by Vital[/i:ee5f65577e]

Nick, it seems like we have kinda big problem with SIGUSR1 restarts here... Two of our dedicated server customers use persistent mysql connections from perl cgi scripts, and here's what we have:

&filename.pl: DBD::mysql::st execute failed: Server shutdown in progress at a filename.pl line XX.&

Application is time-critical, i.e., you can't just reload the page, if it fails. Can i set this thing to restart apache once a day, for example, and if so - how? Also, all php chats with persistent connection and transparent sessions become broken this way... I don't think it was a good idea. But from your point of view, i don't see a way around too, as a system administrator, except of decreasing restart rate.
[/quote:ee5f65577e]

surely if the child exits only after serving the current request it wouldn't effect anything that is still being processed (php chats etc).

I could be wrong ofcourse ;)

Andy.
 

JustinK

Well-Known Member
Sep 4, 2001
251
0
316
This has to do with the logs right? So we should just be able to remove or edit parts of the cpanellogd file to stop this or is there another file we can edit to stop it?
 

TRAIN YARD SOFTWARE

Well-Known Member
Dec 20, 2001
224
0
316
We have same problem.. mo one knows why or what.

restarted every 10 min. apache restarted twice a day/with email, sometimes apache fails and WHM shows it as green. have to click http/appache restart in WHM for apache to work again

-Ed
 

techark

Well-Known Member
May 22, 2002
280
0
316
Well it started on a 3rd server

that had been unaffected by this up until now. Then today 3 servers with in 10 minutes I got 3 emails one rigt after the other apache had failed now waiting to see if a 4th one starts it at the same time.
 

techark

Well-Known Member
May 22, 2002
280
0
316
Dang it

Now my Segusr1 faults have turned to SEGTERM

I get a &caught SEGTERM shutting down&

It is happening on 4 servers now 3 or 4 times a day..

HELP anyone got a clue what to do about this?
 

Jammer2020

Member
Jul 13, 2002
18
0
151
We are getting this as well. Alot of restarts and about every 2 -3 days apache fails and gets automagically restarted.
 

mcogfan

Registered
Jul 23, 2002
4
0
151
cpanellogd

cpanellogd runs every 5 minutes, and every 2 runs (i.e. 10 minutes) it scans the logs, which involves 'gracefully' restarting Apache.

I've disabled this via a 'killall cpanellogd' and no more SIGUSR1 in error_log :)
 

Juanra

Well-Known Member
Sep 22, 2001
777
0
316
Spain
[quote:8ec90e9f44][i:8ec90e9f44]Originally posted by mcogfan[/i:8ec90e9f44]
cpanellogd runs every 5 minutes, and every 2 runs (i.e. 10 minutes) it scans the logs, which involves 'gracefully' restarting Apache.

I've disabled this via a 'killall cpanellogd' and no more SIGUSR1 in error_log :)[/quote:8ec90e9f44]

Doesn't that imply that your users' bandwidth consumption won't be accounted for?
 

mcogfan

Registered
Jul 23, 2002
4
0
151
I'm not really bothered about it, as we're the only ones using the server.

Its definetly not worth the constant restarts. It also affects PHPAccelerator as graceful restarts are not recommend for that product.
 

erobs

Well-Known Member
Nov 24, 2002
48
0
156
This error [notice] SIGUSR1 received. Doing graceful restart
just started on server which had been running fine. Every 10 minutes, any Idea what may be causing it. I know this was a large discussion, any outcome?

Rob
 

Chern Ann

Member
Aug 16, 2002
8
0
151
Solution, modified cpanellogd

It's the Perl script cpanellogd running as a daemon that's causing the 10 minute reboot. I've modified my cpanellogd to only do this once per day so I still get log processing and bandwidth limiting.

Replace this line
sleep(300);
with
sleep(43200);

43200 seconds (12 hours) instead of 300 seconds (5 minutes). Since the script only processes logs every other loop, this will mean log processing only happens once every 24 hours.

If you want to run phpaccelerator, replace all instances of
system(&killall -USR1 httpd&);
with
system(&/etc/rc.d/init.d/httpd stop&);
sleep(20);
system(&/etc/rc.d/init.d/httpd start&);

The above will guarantee that your server does a hard restart. In case the httpd start command does not work, chkserv will still restart the server.
 

jamesbond

Well-Known Member
Oct 9, 2002
738
1
168
Does anyone know why cpanellogd is set to restart apache every 10 min and not for example 6 or 24 hours?

What would be the disadvantage of having it set at 6 hours (aside from the logs processing every 6 hours instead of every 10 min)
 

dgbaker

Well-Known Member
PartnerNOC
Sep 20, 2002
2,548
9
343
Toronto, Ontario Canada
cPanel Access Level
DataCenter Provider
[quote:bcd3c9ae1d][i:bcd3c9ae1d]Originally posted by mcogfan[/i:bcd3c9ae1d]

The modifications were recommended for the cpanellogd files, NOT the chkservd files.[/quote:bcd3c9ae1d]

God it is way to early, you are correct.
 

Chern Ann

Member
Aug 16, 2002
8
0
151
[quote:e0c9155886][i:e0c9155886]Originally posted by jamesbond[/i:e0c9155886]

Does anyone know why cpanellogd is set to restart apache every 10 min and not for example 6 or 24 hours?

What would be the disadvantage of having it set at 6 hours (aside from the logs processing every 6 hours instead of every 10 min)

[/quote:e0c9155886]

It's mentioned somewhere in the middle of the thread. The logs have to be checked so that the Cpanel knows how much bandwidth is being used by each site, and can immediately throttle sites that have gone over their limit. So you'll need to compromise on the frequency of the log running, depending on how many virtual hosts you have and how likely they are to significantly exceed their bandwidth limit within a short period of time.
 

rusko

Member
Nov 20, 2002
11
0
151
is there a reason why killall will break phpaccelerator (havent noticed it breaking) whereas a service stop wont? it all amounts to the same thing afaik (a sigusr sent to the parent apache process)

cheers,
paul
 

mcogfan

Registered
Jul 23, 2002
4
0
151
A killall will actually cause Apache to do a 'graceful' restart.

The way it has been implemented will cause problems with PHPA.