AardvarkBusiness.net - Business Search Engine AardvarkBusiness.net - Business Search Engine



 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

     

apachectl -k graceful ???

 
 
Post new topic   Reply to topic    AardvarkBusiness.net Forum Index -> Domains & Hosting Forum
View previous topic :: View next topic  
Author Message
foundThroughAdminSig
President
President


Joined: 24 Apr 2004
Posts: 6491

7611 ants

PostPosted: Mon Jan 02, 2006 9:50 am    Post subject: apachectl -k graceful ??? Reply with quote

I am currently writing a script to restart Apache2 upon it's hanging/locking up (I know that I need to resolve the problem, but I need the script to mitigate downtime for the time being). I thought about writing the script initially because Apache2 does not go down completely; it seems that Apache2 hangs, but httpd (several) processes keep up and running. I figured that I need to check HTTP, check what Apache2 returns within a reasonable amount of time (10 - 20 seconds?) and if there is no valid return, then restart Apache2. However, I got the following suggestion from a webmaster/programmer/system administrator in some other forum; run apachectl -k graceful every 5 minutes instead of writing the script. I'm not 100% sure if this is what I want to use, and I'd like to ask a couple of questions here.

Q1. Does "apachectl -k graceful" essentially check HTTP? In other words, if Apache2 is in the state that you cannot view any page while you try to access sites hosted using the browser, does "apachectl -k graceful" restart Apache2?

Q1.2. If Apache2 is running without any problem, "apachectl -k graceful" doesn't restart Apache2 unnecessarily, does it?

Q2. How come something like this is not set up by default (I'm using Plesk 7.5.x)?
_________________
Online Education :: Training Forum
Chat about health ... Finance Books
Back to top
View user's profile Send private message Visit poster's website
trev
President
President


Joined: 15 Oct 2002
Posts: 3011
Location: NW England, UK
4037 ants

PostPosted: Tue Jan 03, 2006 3:29 pm    Post subject: Reply with quote

I've used "httpd graceful" before now which looking at the Apache docs appears to do the same thing as you've been given. In essence it restarts Apache, but doesn't kill off anything that it was doing before the command was issued. It'll also start Apache if it wasn't running.

As for unncessary starts - hmm, well they are kind of yeah. I'm not 100% sure what happens if an HTTP request comes in while it's restarting but on our servers the process only takes a few seconds so it's fairly unlikely it'll cause too much of a problem.

Plesk doesn't do this because ideally it shouldn't fall over in the first place, although it certainly does in my experience (nothing like as often as yours mind you). On our servers we run Cpanel and that has a deamon checker which restarts these processes automatically every 5 mins. I'm rather surprised that Plesk doesn't have something like that.

Trev
_________________
Mad Theories - Ambleside - Coniston - Grange
Back to top
View user's profile Send private message Visit poster's website
foundThroughAdminSig
President
President


Joined: 24 Apr 2004
Posts: 6491

7611 ants

PostPosted: Tue Jan 03, 2006 6:18 pm    Post subject: Reply with quote

Trev wrote:
Plesk doesn't do this because ideally it shouldn't fall over in the first place, although it certainly does in my experience (nothing like as often as yours mind you). On our servers we run Cpanel and that has a deamon checker which restarts these processes automatically every 5 mins. I'm rather surprised that Plesk doesn't have something like that.

Trev

Plesk 7.5.4 should have this, but I'm using Plesk 7.5.3. I wanted to write my own script for now because

1. Upgrade doesn't always go smoothly, and I don't want to deal with number of different problems simultaneously.

2. There is really no guarantee that new feature in Plesk 7.5.4 does what I need to do.

3. I needed to write a couple of shell scripts anyway, and this seems like a good time for me to learn.
_________________
Online Education :: Training Forum
Chat about health ... Finance Books
Back to top
View user's profile Send private message Visit poster's website
Sonic
Executive PA
Executive PA


Joined: 09 Sep 2004
Posts: 95
Location: UK
100 ants

PostPosted: Sat Mar 11, 2006 1:43 am    Post subject: Reply with quote

Quote:
As for unncessary starts - hmm, well they are kind of yeah. I'm not 100% sure what happens if an HTTP request comes in while it's restarting but on our servers the process only takes a few seconds so it's fairly unlikely it'll cause too much of a problem.


apachectl -k graceful restarts apache without closing any open sessions. It should only take a few seconds as Trev said. If you were to get a HTTP request during the restart all the client would see was the page hanging until it could connect with the server... which should be seemless.
_________________
Andy Burton
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    AardvarkBusiness.net Forum Index -> Domains & Hosting Forum All times are GMT + 1 Hour
Page 1 of 1

 
Google
 
Business Forum Sport Forum Travel Forum


Powered by php B B © 2001, 2002 php B B Group

AardvarkBusiness.net Business Search Engine & Directory