Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Mon Sep 27, 2010 4:31 pm 
Offline
Senior Member

Joined: Wed Jul 21, 2010 8:04 pm
Posts: 119
Hi!
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!

Jeff


Top
   
 Post subject:
PostPosted: Mon Sep 27, 2010 7:04 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
And why would you want to know when MaxClients is reached? It's not an error, it has no implications for security, and it could happen dozens of times a day depending on your configuration. Raising the value of MaxClients whenever you get the alert is also a recipe for disaster. See this thread.

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.


Top
   
 Post subject:
PostPosted: Mon Sep 27, 2010 7:08 pm 
Offline
Senior Member
User avatar

Joined: Sun Dec 27, 2009 11:12 pm
Posts: 1038
Location: Colorado, USA
Sounds like a lot of "you could" work.

Are there any "they could" solutions?


Top
   
 Post subject:
PostPosted: Mon Sep 27, 2010 7:45 pm 
Offline
Senior Member

Joined: Wed Jul 21, 2010 8:04 pm
Posts: 119
A good point. I guess what I really want is a way of telling when MaxClients is reached repeatedly, as that might be an indication that I need a VPS with more memory. My intention is not to raise MaxClients without raising the amount of RAM I have, as that would cause the VPS to go into swap space. What I'm really looking for is a way to tell if my VPS is underpowered, and unable to keep up with web requests.


Top
   
 Post subject:
PostPosted: Mon Sep 27, 2010 9:07 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Wait a few days, run grep "MaxClients" /path/to/your/apache/log and see how many it throws at you.


Top
   
 Post subject:
PostPosted: Mon Sep 27, 2010 11:47 pm 
Offline
Senior Member

Joined: Mon Jul 05, 2010 5:13 pm
Posts: 392
Or just, ya know, log actual resource usage...

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.


Top
   
 Post subject:
PostPosted: Tue Sep 28, 2010 2:58 am 
Offline
Senior Member

Joined: Wed Jul 21, 2010 8:04 pm
Posts: 119
@akerl - Any recommendations on how to do that?


Top
   
 Post subject:
PostPosted: Tue Sep 28, 2010 6:38 am 
Offline
Senior Member
User avatar

Joined: Fri Oct 24, 2003 3:51 pm
Posts: 965
Location: Netherlands
jzimmerlin wrote:
Any recommendations on how to do that?

Munin

_________________
/ Peter


Top
   
 Post subject:
PostPosted: Wed Sep 29, 2010 2:21 am 
Offline
Senior Member

Joined: Wed Jul 21, 2010 8:04 pm
Posts: 119
Thanks! I played around with Munin. It's great!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group