Randy Schmidt on 20 Jan 2008 20:03:28 -0800


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

[PhillyOnRails] Monit + Mongrel

  • From: "Randy Schmidt" <randy.schmidt@gmail.com>
  • To: "Philly on Rails ML" <talk@phillyonrails.org>
  • Subject: [PhillyOnRails] Monit + Mongrel
  • Date: Sun, 20 Jan 2008 23:02:49 -0500
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=2MaFblo0d55CoZ8diyOijzbK3cgXdizoFurrWPAXhlE=; b=F+G6gLrvaSjHhkgQWFboRw1UXXxjIrOecbAb3KhBSkTWba1ezWIYPL71m56Dj86gHNMP2+bNq6WShUxHP3ef8AbiWhEYfo+nijMLSnETJQmtu/Z4ERxGnDjNDAPZqTWjsIq0DAi8ayHOQuu4vvTXzJdTfFyIfHVbw71DAwS0Ob4=
  • List-archive: <http://lists.phillyonrails.org/pipermail/talk>
  • Reply-to: talk@phillyonrails.org
  • Sender: talk-bounces@phillyonrails.org

Hi,

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: monit@umlatte.com }
set alert sysadmin@umlatte.com
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 127.0.0.1 -c /var/www/apps/wire/staging/current
-p 6000 -P /var/www/apps/wire/staging/current/log/mongrel.6000 -l
/var/www/apps/wire/staging/current/log/mongrel.6000"
	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!
Randy
_______________________________________________
To unsubscribe or change your settings, visit:
http://lists.phillyonrails.org/mailman/listinfo/talk