Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to configure apache2 to stop serving requests if a specific value of server load (like the value that you see when using htop) is reached? Ideally a predefined static page should be served in such case?

If this doesn't make sense then what is the correct way of letting the server rest if it's getting overloaded? Except for correctly configuring all the values in apache2 configuration of course. I need a temporary rescue solution.

share|improve this question

Sounds like you're running into scalability issues. Unfortunately, I don't think Apache has this mechanism. The correct way I've seen it done is by having a reverse proxy of sorts (nginx or even HAProxy) sit in front of Apache and check the response times. If it's too slow, it can display a "sorry" page and let Apache cool off.

Hope this guides you in the right direction.

share|improve this answer

You can see if monit can help you. It has a load trigger that you can use to restart servers, run custom scripts and etc... Maybe you can create a custom script to change apache config files.

Varnish has a Saint mode with Grace time, it will show the last version of the cache if a backend takes too long to respond, maybe it is better than just showing a "sorry" page. OTOH, varnish is not trivial to configure.

share|improve this answer

Your Answer


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.