Passenger (mod_rails) with Mephisto

With what appears at first glance as a solution to the "complicated" problems of hosting Rails apps Passenger could make the Rails world an even happier place to live. Less administration and more coding.

Well that was too easy. Following the simple Passenger instructions on this CentOS 5 box and now the blog is running on mod_rails 1.0.1. Passenger runs using the user/group of your app's config/environment.rb so some changes in permission for my cache and asset directories was all I had to do. Memory use doesn't seem to be any higher than a mongrel and I haven't seem any performance problems. Not exactly a high traffic site.

If this proves to be stable Rails just took a big leap for many sites. Using an app server still offers some nice benefits but at this point I'll be quite happy installing Passenger on most hosts.

Time will tell though.

UPDATE Just FYI for anyone using 1.0.1 if you have Rails' page cache directory set to something other than public/ Passenger currently doesn't honor that. Hongli on #passenger on freenode has informed me that's fixed in the development version. So it should be in the next release.

UPDATE 05/07/08 See graph below to see the difference in memory usage between the site with Mongrel and the site with Passenger. No problems yet to report with using Apache Worker with it. Upgraded to Passenger 1.0.4.

UPDATE 05/23/08 The second graph shows two changes. The first was I dropped the number of MinSpareThreads and MaxSpareThreads to cut down on the Committed memory. For a rundown of what the committed memory on munin means I would refer you to this RedHat Article.

The second drop was when I paid attention to the Passenger Documentation and dropped my RailsMaxPoolSize in my Apache configuration file to 2. Now running passenger-memory-stats I show less than 7MB of dirty memory.

Also a great post by Technoweenie over at NubyOnRails about mod_rails

UPDATE 06/19/08 Upgraded to Ruby Enterprise, also from the Phusion guys and the latest Passenger from Github. In the third chart you can see that, around the 17th the memory usage dropped, although Swap usage bumped up a little bit. I'll see over the next week if committed memory remains in a lower range. That gap of space in the chart is due to a server crash. One which I am not sure of the cause unfortunately.

What is interesting to me is the drop in the Individual Interrupts and Interupts and Context Switches. Not sure what they do yet though. I'll dig up some Google links in a bit.

When you do install Ruby Enterprise though, be sure to install the necessary gems for your app. I forgot this step and missed installing tzinfo and image_science. If you install to /opt/ like the default install recommends just run /opt/ruby-ent/bin/gem install tzinfo image_science.

Oh, and if you're on a VPS I would suggest running gem install with --no-rdoc and --no-ri for a faster install. Unless of course you're developing on it at the same time.

UPDATE 07/08/08 After a couple of weeks things are looking good. The monthly memory graph below shows that my committed memory is now staying under the total available memory which is good. There haven't been any of those random spikes/crashes that occurred early on so I'm happy to keep Passenger running on this VPS server.

April 22nd, 2008

1 Response to “Passenger (mod_rails) with Mephisto”

  1. David Jones Says:
    Thanks for that Paul. We experienced the exact same issue with the committed memory and have munin setup like you so our graphs were the same.

Leave a Reply

design by gorotron ported by railsgrunt powered by mephisto