Skip to content

Instantly share code, notes, and snippets.

@jlecour
Created March 7, 2012 16:44
Show Gist options
  • Save jlecour/1994287 to your computer and use it in GitHub Desktop.
Save jlecour/1994287 to your computer and use it in GitHub Desktop.
Monit config for Resque workers.
check process resque_api_0
with pidfile /home/deploy/apps/api/current/tmp/pids/resque_worker_0.pid
start program = "/bin/sh -c 'cd /home/deploy/apps/api/current; GEM_HOME=/home/deploy/.gem/ruby/1.8 GEM_PATH=/home/deploy/.gem/ruby/1.8 PATH=$PATH:/home/deploy/.gem/ruby/1.8/bin:./bin nohup bundle exec rake environment resque:work RAILS_ENV=production QUEUE=* PIDFILE=tmp/pids/resque_worker_0.pid INTERVAL=2 >> log/resque_worker_0.log'" as uid deploy and gid deploy
stop program = "/bin/sh -c 'cd /home/deploy/apps/api/current && kill -s QUIT `cat tmp/pids/resque_worker_0.pid` && rm -f tmp/pids/resque_worker_0.pid; exit 0;'"
if totalmem is greater than 350 MB for 10 cycles then restart # eating up memory?
GROUP resque_api
check process resque_api_0
with pidfile /home/deploy/apps/api/current/tmp/pids/resque_worker_0.pid
start program = "/bin/sh -c 'cd /home/deploy/apps/api/current; nohup bundle exec rake environment resque:work RAILS_ENV=production QUEUE=* PIDFILE=tmp/pids/resque_worker_0.pid INTERVAL=2 >> log/resque_worker_0.log'" as uid deploy and gid deploy
stop program = "/bin/sh -c 'cd /home/deploy/apps/api/current && kill -s QUIT `cat tmp/pids/resque_worker_0.pid` && rm -f tmp/pids/resque_worker_0.pid; exit 0;'"
if totalmem is greater than 350 MB for 10 cycles then restart # eating up memory?
GROUP resque_api
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment