Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Passenger monitoring with Monit

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 MIT-LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 VERSION
Octocat-spinner-32 init.rb
Octocat-spinner-32 passenger_monit.gemspec
README.md

PassengerMonit

This plugin provides means for monitoring Rails application which run under Passenger with Monit.

The pid file name (hardcoded) is /var/tmp/rack.X.pid, where X denotes the instance number.

Installation

Add this line to your Gemfile:

gem 'passenger_monit', :group => :production

Example Monit configuration

check process instance1 with pidfile /var/tmp/rack.1.pid
    group web
    start program = "/bin/true" with timeout 30 seconds
    stop program = "/bin/sh -c 'kill `cat /var/tmp/rack.1.pid`'"
    if totalmem > 120.0 MB for 5 cycles then restart
    if changed pid 2 times within 2 cycles then alert
    if changed ppid 2 times within 2 cycles then alert

Bugs and missing features

  1. Only tested with nginx
  2. The pid file location is hardcoded
  3. Sometimes there are more passenger instances in the air than anticipated, so when one goes down, there might be first pid file missing, e.g.: from [rack.1.pid, rack.2.pid] to [rack.1.pid, rack.2.pid, rack.3.pid] to [rack.2.pid, rack.3.pid] - monit will complain that the first instance is missing.

Copyright (c) 2011 Roman Shterenzon, released under the MIT license

Something went wrong with that request. Please try again.