Skip to content

Instantly share code, notes, and snippets.

@v1bh0r
Last active August 29, 2023 07:38
Show Gist options
  • Save v1bh0r/9ecee572b192cab1ee23 to your computer and use it in GitHub Desktop.
Save v1bh0r/9ecee572b192cab1ee23 to your computer and use it in GitHub Desktop.
Sidekiq Monit Configuration example
check process sidekiq_myapp
with pidfile /path/to/sidekiq.pid
start program = "bundle exec sidekiq -C /path/to/sidekiq_conf.yml -P /path/to/sidekiq.pid" with timeout 30 seconds
stop program = "kill -s TERM `cat /path/to/sidekiq.pid`" with timeout 30 seconds
if totalmem is greater than 500 MB for 2 cycles then restart # VM bloat is common in Rails apps
if totalmem is greater than 800 MB for 1 cycles then restart # If a rogue job tries to consume memory quickly
group myapp_sidekiq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment