Dec 2, 2010

Pain-killing one-liner for monitoring Phusion Passenger

Finally, I found a good article here describing the same problem I've met with Phusion Passenger which the memory usage can't be monitored by monit.

Here's the working command:
kill $(/opt/ruby-enterprise-1.8.7-2010.02/bin/passenger-memory-stats | grep '[56789]..\.. MB.*Rails' | awk '{ print $1 }')
This command means 'find out Rails sub-processes which consumes 500-999MB private memory will be killed.

I run it once per minute on my production server.


It just works.