Skip to content

Instantly share code, notes, and snippets.

@raecoo
Forked from jlecour/monit_sidekiq
Last active August 29, 2015 14:20
Show Gist options
  • Save raecoo/7298c15e2426d259855c to your computer and use it in GitHub Desktop.
Save raecoo/7298c15e2426d259855c to your computer and use it in GitHub Desktop.
check process sidekiq_01
with pidfile /path/to/app/current/tmp/pids/sidekiq.pid
start program = "/bin/sh -c 'cd /path/to/app/current; PATH=bin:/path/to/rbenv/shims:/path/to/rbenv/bin:$PATH nohup bundle exec sidekiq -e production -i 0 -P tmp/pids/sidekiq.pid >> log/sidekiq.log 2>&1 &'" as uid app_user and gid app_group with timeout 90 seconds
stop program = "/bin/sh -c 'cd /path/to/app/current; PATH=bin:/path/to/rbenv/shims:/path/to/rbenv/bin:$PATH bundle exec sidekiqctl stop tmp/pids/sidekiq.pid'" as uid app_user and gid app_group with timeout 90 seconds
if totalmem is greater than 500 MB for 2 cycles then restart # eating up memory?
group sidekiq
check process sidekiq_02
with pidfile /path/to/app/current/tmp/pids/sidekiq.pid-1
start program = "/bin/sh -c 'cd /path/to/app/current; PATH=bin:/path/to/rbenv/shims:/path/to/rbenv/bin:$PATH nohup bundle exec sidekiq -e production -i 1 -P tmp/pids/sidekiq.pid-1 >> log/sidekiq.log 2>&1 &'" as uid app_user and gid app_group with timeout 90 seconds
stop program = "/bin/sh -c 'cd /path/to/app/current; PATH=bin:/path/to/rbenv/shims:/path/to/rbenv/bin:$PATH bundle exec sidekiqctl stop tmp/pids/sidekiq.pid-1'" as uid app_user and gid app_group with timeout 90 seconds
if totalmem is greater than 500 MB for 2 cycles then restart # eating up memory?
group sidekiq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment