Have you ever come across a term called Mod_rails or passenger while visiting a ruby on rails site ?

What is mod_rails ?

Mod_rails is an Apache module that enables the Ruby on Rails application to work with Apache for delivering high performance. Various tests have proven that passenger apps are faster,reliable and robust when compared to FastCGI/Mongrel served apps.

How passenger apps provide higher performance than a Mongrel/FastCGI application ?

Passenger with Ruby Enterprise edition is significantly better in terms of Virtual Memory Size and there by offers a much more stable performance than its competitors. Moreover passenger process get spawned only when a hit comes for a particular URL and it dies after a sometime.

How to enable passenger of an application and how to restart it ?

Its simple.. Just add the following code to the vhost settings of the domain

RailsBaseURI /

and for restarting passenger just create a file called restart.txt under the tmp directory of the application.. like this

#[yourapp] touch tmp/restart.txt

*    In the newer version of passenger the restart.txt file doesn’t get removed. Instead , the passenger checks the time stamp of the restart.txt and restarts automatically.

Is Mod_rails a right choice for shared hosting environment ?

YES, as we all know mod_rails instances die after a while , saves a lot of memory when compared to mongrel which stay running forever. Also, an improved architectural framework for passenger manages the VM utilization effectively.

Why Ruby Enterprise Edition for Passenger ?

Ruby enterprise edition is a server oriented version of ruby interpreter and it has  advanced memory management features than ordinary Ruby interpreter.

How Apache recognizes passenger ?

We need to load the passenger module by manually including it in the Apache config file.

Add the following lines

LoadModule passenger_module /opt/rubyenterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/passenger-2.1.3/ext/apache2/mod_passenger.so

PassengerRoot /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/passenger-2.1.3

Contact Us On WhatsApp