Side effects of an Apache2 Reload event

Solution 1:

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,

Solution 2:

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.