Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I was wondering what effect external clients would see on a fairly busy site if the apache2 server was reconfigured and then an /etc/init.d/apache2 reload command was issued?

I know in theory current actions should hold without issues, but what would the total effect be on the site?

For the sake of this example, lets assume i want to perform a reload once per minute. would this degrade the site performance a great deal?

Thanks

share|improve this question

migrated from stackoverflow.com Dec 13 '09 at 0:54

This question came from our site for professional and enthusiast programmers.

    
Judging from a previous comment you left, you mentioned a SVN repository. I am fairly confident that you can create a SVN repo on the fly. And for user auth, you can use a MySQL DB. I HATE restarting servers or services unless I really have to. Leave a comment if you want me to post an answer with more info. –  Nathan Adams Dec 13 '09 at 1:34
    
Nathan: Sorry for the late response, i would certainly be interested in some more info here, I have not been able it make it work at all... –  BParker Dec 13 '09 at 21:57
add comment

2 Answers

Using /etc/init.d/apache2 reload is the equivalent of a graceful restart. As you said the current connections are carried to the end before the child dies. As children dies they are replaced by new children with the new configuration (see apache doc for restarting).

In practice it might slow down a little as it takes some ressources to restart the child, reload the config and close & open log files, but that is hardly noticeable for the clients.

As for your example, it probably depends on how much free ressources you have on your server and on the size of the log files and the config but it wouldn't kill the site performance in my view.

share|improve this answer
add comment

G'day,

I suspect that reloading one a minute would affect your site performance but it would very much depend on:

  • your configuration: what MPM are you using? prefork or worker? what is the number of children that you have specified? And in the case of worker, what is your max threads per child. This will affect how long the processes have to hang around due to the graceful nature of the shutdown.
  • what people are doing on your site: are they downloading large files? this naturally leads to longer sessions and hence longer times for the processes to exit and be restarted
  • what you are logging: this is somewhat related to the previous point but if you are logging bytes served then the log entry will only be made after the download session is completed.
  • are you using Apache 2.2.12 or later: then you have the possibility of specifying a maximum time for "graceful" to work before the process is killed and restarted.

All of these will affect your response time to the reload. I think having a reload per minute is a bit excessive and will only degrade your site performance.

I'd suggest making a server HUP part of the process when a new config is rolled out as we do.

We've seen maximum traffic levels of 3.8 million hits per second and 7 million hits per second for over an hour during major news events and such an approach to config updates does not affect our servers.

HTH

cheers,

share|improve this answer
1  
From the Apache docs i assume a HUP is a full /etc/init.d/apache2 restart? Why would this be better than a reload? My understanding is that with a reload, all NEW connection would take on the new config state, while all currently active connections would continue in their old config state. I would say a full restart at regular intervals would seem a safe option, but does a full restart not cause more disruption to the site? Does anyone have any data about this? Thanks –  BParker Dec 12 '09 at 17:42
    
G'day, we've found that we were getting some strange behaviour using the graceful|restart option. Primarily that some child processes were left hanging around. Sometimes as zombies. My undertanding is that doing a HUP will force an immediate shutdown and reload, i.e. it is not graceful. I am actually playing with this at the moment. The new "||" syntax for logging will enable us to rotate our logs nightly without having to HUP the Apache servers and have them just drop connections which is currently a problem with large downloads of programmes for a certain major UK streaming service. ;-) –  Rob Wells Dec 12 '09 at 17:54
    
... (ran out of space). Regularly HUP'ing your site will cause service disruption and you are better off attempting a graceful restart. But I'd take a look at how often you are expecting to modify configs and then come up with your restart frequency from there. What sort of load are your servers under? –  Rob Wells Dec 12 '09 at 17:56
    
BTW "It Works!!!" (-: (Just had a peek) –  Rob Wells Dec 12 '09 at 17:58
    
at the moment the servers are under a fairly limited load, so i have the chance to play around. I am doing some subversion hosting, and the config files change whenever a new repository is created, which is a relatively quiet activity in terms of server traffic. My thinking was that since most of the normal activity is during daylight hours, it would be OK to do a full restart every night (assuming there had been some reloads performed during the day), but otherwise keep with reload commands to keep things working during the day. I was concerned that a reload would cause issues for clients- –  BParker Dec 12 '09 at 20:51
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.