Skip to content

Instantly share code, notes, and snippets.

@jlecour
Created March 10, 2014 09:17
Show Gist options
  • Save jlecour/9461848 to your computer and use it in GitHub Desktop.
Save jlecour/9461848 to your computer and use it in GitHub Desktop.
Monit configuration for 2 Sidekiq processes, with Rbenv.
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