Is there a way to get alerted when MaxClients is reached?
Does anybody know a way to get alerted via e-mail when MaxClients is reached? I have a Ubuntu 10.04 VPS with Apache, PHP, and MySQL, and have been trying to figure out a way to do this with LogWatch, but have been unsuccessful. Maybe there's another way?
I'd appreciate any thoughts or suggestions you might have!
You could write a script that uses "tail" to grab the last X lines of Apache's error log, "grep" to find the MaxClients entry, and "wc -l" to check if there are any matching lines. If a matching line is found, use the "mail" program to send an e-mail. You could put the script in root's crontab and run it every Y minutes.
Since your desired result is knowing whether or not your setup needs more resources or not, why use a middleman like MaxClients to get an answer? It seems like what you really want to do is monitor actual system load during standard use.