Monit and Unicorn rails

 linux, rails  Comments Off on Monit and Unicorn rails
Nov 192010
 

This is a monit recipe for a rails app with 4 Unicorn threads using SOCKET. The app averages a total memory usage of 600 MB.
If it goes over 800 MB send email alert only.
If over 860 MB, reload the app.
Also if it’s using too much CPU, alert by email.ceoec.ru

I use unicorn_rails on socket mode with nginx, and preload_app = true.

note: the HUP signal will reload the children processes without reloading code changes. This is fast and desirable.

Resources:
http://unicorn.bogomips.org/SIGNALS.html
http://mmonit.com/monit/documentation/monit.html

 Posted by at 7:18 pm  Tagged with:

Switch to our mobile site