Quantcast

Phusion Passenger is the best option for hosting Ruby based web apps (anything that uses Rack is compatible). When used with Ruby EE to serve Ruby on Rails applications it will consume up to 33% less memory than other servers such as Mongrel.

Not everything is kittens and rainbows however, as Passenger won’t prevent your app from choking your server if you consume too much memory (via memory leaks in your app, etc). Schedule this script to run every couple of minutes to kill any Passenger processes are consuming too much memory. Passenger will automatically start new ones as needed. You’ll have to figure out for yourself how much is “too much”. In my case it’s 200 MB.

It’s also useful to know how many process Passenger is using, so you can increase the MaxPoolSize when traffic increases. I use Munin to track system statistics and have written two wrappers around the Passenger system tools. The first wraps passenger-memory-stats and the second wraps passenger-status

The result are graphs such as these:

Munin graphs can be extremely helpful when tracking down system performance issues. I highly recommend it.

Sorry, comments are closed for this article.