Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- check process my_cool_app_unicorn with pidfile /home/app_user/app/shared/tmp/pids/unicorn.pid
- alert email@example.com
- start program = "/bin/su - app_user -c '/home/app_user/app/shared/config/unicorn start'"
- stop program = "/bin/su - app_user -c '/home/app_user/app/shared/config/unicorn stop'"
- if mem is greater than 300.0 MB for 3 cycles then restart
- if cpu is greater than 50% for 6 cycles then alert
- if cpu is greater than 80% for 9 cycles then restart
- group my_cool_app_unicorn
- check process my_cool_app_unicorn_worker_0 with pidfile /home/app_user/app/shared/tmp/pids/unicorn.0.pid
- start program = "/bin/true"
- stop program = "/usr/bin/test -s /home/app_user/app/shared/tmp/pids/unicorn.0.pid && /bin/kill -QUIT `cat /home/app_user/app/shared/tmp/pids/unicorn.0.pid`"
- if mem > 300.0 MB for 3 cycles then stop
- if cpu > 80% for 9 cycles then stop
- if 5 restarts within 15 cycles then timeout
- alert email@example.com only on { pid }
- if changed pid 2 times within 60 cycles then alert
- group my_cool_app_unicorn_workers
- check process my_cool_app_unicorn_worker_1 with pidfile /home/app_user/app/shared/tmp/pids/unicorn.1.pid
- start program = "/bin/true"
- stop program = "/usr/bin/test -s /home/app_user/app/shared/tmp/pids/unicorn.1.pid && /bin/kill -QUIT `cat /home/app_user/app/shared/tmp/pids/unicorn.1.pid`"
- if mem > 300.0 MB for 3 cycles then stop
- if cpu > 80% for 9 cycles then stop
- if 5 restarts within 15 cycles then timeout
- alert email@example.com only on { pid }
- if changed pid 2 times within 60 cycles then alert
- group my_cool_app_unicorn_workers
- check process resque_worker
- with pidfile /home/app_user/app/shared/tmp/pids/resque_worker.pid
- start program = "/bin/su - app_user -c 'export RUBYOPT=-Ku;cd /home/app_user/app/current;bundle exec rake environment resque:work QUEUE=* RAILS_ENV=production VERBOSE=1 PIDFILE=/home/app_user/app/shared/tmp/pids/resque_worker.pid & >> /home/app_user/app/shared/log/resque_worker.log 2>&1'" as uid app_user and gid app_user
- stop program = "/bin/sh -c 'kill -9 $(cat /home/app_user/app/shared/tmp/pids/resque_worker.pid) && rm -f /home/app_user/app/shared/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
- check process redis
- with pidfile /var/run/redis.pid
- start program = "/usr/local/bin/redis-server /usr/local/etc/redis.conf"
- stop program = "/usr/local/bin/redis-cli -p 6379 shutdown"
- check process nginx with pidfile /var/run/nginx.pid
- alert email@example.com
- start program = "/usr/local/etc/rc.d/nginx start"
- stop program = "/usr/local/etc/rc.d/nginx stop"
- if children > 250 then restart
- if 5 restarts within 5 cycles then timeout
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement