Skip to content

Instantly share code, notes, and snippets.

@gretch
Created March 21, 2011 03:14
Show Gist options
  • Select an option

  • Save gretch/878957 to your computer and use it in GitHub Desktop.

Select an option

Save gretch/878957 to your computer and use it in GitHub Desktop.
resque - monit
#from defunkt
check process resque_worker_QUEUE
with pidfile /data/APP_NAME/current/tmp/pids/resque_worker_QUEUE.pid
start program = "/bin/sh -c 'cd /data/APP_NAME/current; nohup rake environment resque:work RAILS_ENV=production QUEUE=queue_name VERBOSE=1 PIDFILE=tmp/pids/resque_worker_QUEUE.pid & > log/resque_worker_QUEUE.log" as uid deploy and gid deploy
stop program = "/bin/sh -c 'cd /data/APP_NAME/current && kill -s QUIT `cat tmp/pids/resque_worker_QUEUE.pid` && rm -f tmp/pids/resque_worker_QUEUE.pid; exit 0;'"
if totalmem is greater than 300 MB for 10 cycles then restart # eating up memory?
group resque_workers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment