Skip to content

Instantly share code, notes, and snippets.

Created December 7, 2010 14:52
Show Gist options
  • Save anonymous/731854 to your computer and use it in GitHub Desktop.
Save anonymous/731854 to your computer and use it in GitHub Desktop.
# monit starts with a blank path, so need to declare full paths to stuff
check process beefeating_unicorn_rails with pidfile /home/paul/public/beefeatingmonkeys.com/shared/pids/unicorn.pid
start program = "/bin/su - paul -c 'cd /home/paul/public/beefeatingmonkeys.com/current;/home/paul/.rvm/gems/ree-1.8.7-2010.02@beefeatingmonkeys/bin/unicorn_rails -D -E production -c config/unicorn.rb'"
stop program = "/usr/bin/killall -9 unicorn_rails" as uid paul and gid paul
if totalmem is greater than 300 Mb for 5 cycles then alert
if cpu is greater than 50% for 2 cycles then alert
if cpu is greater than 80% for 3 cycles then restart
if loadavg(5min) greater than 10 for 8 cycles then restart
if 5 restarts within 20 cycles then timeout
if failed unixsocket /home/paul/public/beefeatingmonkeys.com/shared/pids/unicorn.sock
then restart
group unicorn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment