Skip to content

Instantly share code, notes, and snippets.

@dmin7b5
Forked from sarogers/Monit to the Resque
Created March 20, 2014 15:19
Show Gist options
  • Save dmin7b5/9666168 to your computer and use it in GitHub Desktop.
Save dmin7b5/9666168 to your computer and use it in GitHub Desktop.
check process resque_worker
with pidfile /home/USER_NAME/dp20/current/tmp/pids/resque_worker.pid
start program = "/usr/bin/env HOME=/home/USER_NAME RACK_ENV=production PATH=/usr/local/bin:/usr/local/ruby/bin:/usr/bin:/bin:$PATH /bin/sh -l -c 'cd /home/USER_NAME/dp20/current; nohup bundle exec rake environment resque:work RAILS_ENV=production QUEUES=record_event,update_counter_cache VERBOSE=1 PIDFILE=tmp/pids/resque_worker.pid & >> log/resque_worker.log 2>&1'" as uid USER_NAME and gid USER_NAME
stop program = "/bin/sh -c 'cd /home/USER_NAME/dp20/current && kill -9 $(cat tmp/pids/resque_worker.pid) && rm -f tmp/pids/resque_worker.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