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 must make a web page that alert users , this page appair only if apache connections clients exceed specific value, for example 150 or more

share|improve this question
1  
That's good to know. Did you have a question you wanted to ask? –  womble Apr 21 '12 at 13:27
    
An error page doesn't make sense in this case, as Apache has to accept the new connection to send the error. Maybe a reverse proxy just in front of your Apache can solve this problem. But there will be a problem if the reverse proxy reaches its connection limit as well. Usually the limit will be higher and will maybe solve your problem but this can be continued ... –  Jens Bradler Apr 21 '12 at 14:42
add comment

1 Answer

As far as I know, there's no built-in, or other good way to do this. If you really must do this, this shell command will give you the number of Apache processes:

ps -C apache2 | wc -l

You could execute that in a Bash script via cron and then, for example, update Apache settings to show the page that alerts users if the value is above 150. Or you could execute it in PHP and show output accordingly.

share|improve this answer
add comment

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.