i used an excellent article a while back to set up a launch daemon for
my rails apps on my mac.
now i am at the point where i am ready to move a few things over to
production and i'm wondering what the best way of doing this is on
other operating systems. currently i am using CentOS 3.8 i686.
what are other people doing to keep their apps running? if one goes
down or i have to restart, i'm basically having to go in and start
mongrel for every app i have running on the site.
I have to second this recommendation. We just started using monit to
monitor our mongrels this past week, and we couldn't be happier. Not
only does it monitor whether the service is up or not, it also monitors
cpu and memory usage, allowing you to take action appropriately. If
that isn't enough, it also provides a simple web interface, giving you
up to the minute info on all your processes, allowing you to restart
them right from the interface.
Here is an example of the configuration syntax:
check process mongrel_8000 with pidfile /path/to/mongrel.8000.pid
start program "/usr/bin/mongrel_rails cluster::start -C
/path/to/mongrel_cluster.yml"
stop program "/usr/bin/mongrel_rails cluster::stop -C
/path/to/mongrel_cluster.yml"
# alert me if memory is greater than 40MB
if totalmem > 40.0 MB for 2 cycles then alert
# restart if memory is greater than 50MB
if totalmem > 50.0 MB for 4 cycles then restart