#1  
Old 23rd December 2007, 19:09
edge edge is offline
Moderator
 
Join Date: Dec 2005
Location: The Netherlands
Posts: 2,034
Thanks: 264
Thanked 151 Times in 131 Posts
Default Monit, and Apache2

After some "big" tweaks of my apache2.conf file I can not get Monit to monitor Apache2 anymore.

I know that I need to set the Monit values (/etc/monit/monitrc) accordingly to what it's set in apache2.conf, but here is where I get lost!

This is the part that I've changed in apache2.conf
Quote:
<IfModule prefork.c>
ServerLimit 512
StartServers 50
MinSpareServers 50
MaxSpareServers 10
MaxClients 200
MaxRequestsPerChild 100
</IfModule>
Now I need to set the correct values in "/etc/monit/monitrc"

The monitrc files looks like this at the moment.
Quote:
check process apache with pidfile /var/run/apache2.pid
group www
start program = "/etc/init.d/apache2 start"
stop program = "/etc/init.d/apache2 stop"
if failed host www.domainname_removed port 80 protocol http
and request "/monit/token" then restart
if cpu is greater than 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if totalmem > 700 MB for 5 cycles then restart
if children > 512 then restart
if loadavg(5min) greater than 10 for 8 cycles then stop
if 3 restarts within 5 cycles then timeout
Problem is that Monit is giving me a "Connection failed" on Apache with the new apache2.conf settings :/

I think the problem is the "if totalmem > 700 MB for 5 cycles then restart", as when I take this line out, it's working fine.
The monit document is saying this about totalmem:
Quote:
The equivalent of mem, except totalmem is an aggregation of memory, not only used by a process but also by all its child processes.
The syntax is the same as above.
If I read the above correct I need to multiple ServerLimit by it's child processes (I guess that this is MaxRequestsPerChild)
So.. 512 x 100 = 51200 MB.
Wow.. 51200 MB... For sure this is wrong!.. Or.. Did I make a mistake in (1) the apache2.conf (setting MaxRequestsPerChild to 100) or (2) with my calculation for totalmem?

Anyone here who's got more info on this?
__________________
Never execute code written on a Friday or a Monday.

Last edited by edge; 23rd December 2007 at 20:05.
Reply With Quote
Sponsored Links
  #2  
Old 24th December 2007, 13:42
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

I've taken out the totalmem line in my monit configuration. I was getting error messages saying that monit doesn't know that option. I guess that Debian's monit package isn't the newst one...
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 24th December 2007, 13:54
edge edge is offline
Moderator
 
Join Date: Dec 2005
Location: The Netherlands
Posts: 2,034
Thanks: 264
Thanked 151 Times in 131 Posts
 
Default

Quote:
Originally Posted by falko
I've taken out the totalmem line in my monit configuration. I was getting error messages saying that monit doesn't know that option. I guess that Debian's monit package isn't the newst one...
For now I have also removed it, but I would love to get the correct value for it.

The monit version I'm using is 4.8.1, and it does take a "totalmem" option.
Quote:
monit -V
This is monit version 4.8.1
Copyright (C) 2000-2006 by the monit project group. All Rights Reserved.
__________________
Never execute code written on a Friday or a Monday.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 19:20.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.