Showing posts from March, 2015

Keep sidekiq running using monit

As an application grows it starts taking care of more and more work. At some point the first task comes that needs to be processed in background and one of the usual suspects for ruby is sidekiq. Now, did it ever happen to you that you get it all up and running on the server and next thing you know it's down and you get error reports that stuff ain't working? Meet monit, a tool that'll let you get ahead of trouble. It automatically restarts programs when down and can even send emails upon failures. Install monit Depending on your package manager this may differ: apt-get install monit yum install monit brew install monit Configure monit Edit  /etc/monit.conf or  /etc/monitrc Uncomment(or add) these lines: set httpd port 2812 and use address localhost allow localhost Add sidekiq entry Create the file /etc/monit.d/sidekiq.monitrc with: check process sidekiq_application_production0 with pidfile /path/to/shared/tmp/pids/side