Cliff Moon on 20 Jan 2008 20:13:44 -0800

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PhillyOnRails] Monit + Mongrel

check your mongrel log, if the kill failed then the new process won't start since the old process is still bound to port 6000. Not sure other than that. We use god for our monitoring and it's worked out pretty great so far. Of course, the author of god sits in the next cube over, so YMMV.

Randy Schmidt wrote:

Does anybody here have experience with Monit and Mongrel? The commands
I have for start program and stop program work by themselves on the
command line, however, in monit, they don't seem to work. I get:

: monit -g wire_staging_mongrels restart mongrel_6000
'mongrel_6000' trying to restart
'mongrel_6000' stop: /usr/local/bin/ruby
Sending TERM to Mongrel at PID 3930...Done.
'mongrel_6000' start: /usr/local/bin/ruby
'mongrel_6000' failed to start

with this config file:

set daemon 60
set mailserver localhost
set mail-format { from: }
set alert
set logfile syslog facility log_daemon
set httpd port 2812 and
	use address localhost # and only accept connection from localhost
	allow localhost       # allow localhost to connect to the server and
  allow admin:monitor     # user 'admin' with password 'monit'

check process mongrel_6000
	with pidfile /var/www/apps/wire/staging/current/log/mongrel.6000
	start program = "/usr/local/bin/ruby /usr/local/bin/mongrel_rails
start -d -e staging -a -c /var/www/apps/wire/staging/current
-p 6000 -P /var/www/apps/wire/staging/current/log/mongrel.6000 -l
	stop program = "/usr/local/bin/ruby /usr/local/bin/mongrel_rails stop
-P /var/www/apps/wire/staging/current/log/mongrel.6000"
	if mem is greater than 60.0 MB for 4 cycles then restart # eating up memory?
	if cpu is greater than 50% for 2 cycles then alert # send an email to admin
	if cpu is greater than 80% for 3 cycles then restart # hung process?
	if loadavg(5min) greater than 4 for 8 cycles then restart  # bad, bad, bad
	GROUP wire_staging_mongrels

Some more info:
  * Yes, the environment is actually staging
  * I'm using mongrel_rails by itself instead of mongrel cluster
because when doing /usr/local/bin/mongrel_rails cluster::restart, it
uses mongrel_rails and monit can't find it (there is a very limited
PATH setup

Any help would be greatly appreciated.

Thank you!
To unsubscribe or change your settings, visit:

To unsubscribe or change your settings, visit: