Installing Phusion Passenger as part of your development environment makes it easy and quick to work on multiple Rails projects simultaneously. Installing Phusion Passenger as part of your production environment speeds up your server response and simplifies server setup.
History of Ruby on Rails Deployment
The initial server used for Rails was WEBrick, which is written entirely with Ruby and bundled with releases of the Ruby interpreter. Because it is available in any environment that can run Rails, WEBrick remains the default server for Rails and is invoked by the Script/Server command from a Rails application, if no other server is available. However, its performance and scalability characteristics are poor, and it’s rarely used in production.
Over time, a server named Mongrel has emerged as the most commonly used alternative to WEBrick for both development and production, due to better performance and greater flexibility. In development mode, typically a single Mongrel instance is run; however, in production, a cluster of multiple instances is run for increased performance. (Until very recently, Rail’s single-threaded nature made multiple servers a practical requirement for any production system.) The resulting Mongrel cluster requires separate load-balancing software to distribute requests among the Mongrel instances. In production, load balancing for Mongrel is often handled by an external web server, such as Apache, which also handles requests for static content not managed by Rails.
Why Phusion Passenger?
Why Phusion Passenger?
Although Mongrel remains popular, Phusion Passenger has gained significant support since the release of version 2.0, including the decision by 37Signals to move its flagship Rails applications to a Phusion Passenger back end. Passenger offers several advantages to a Rails developer—most notably, ease of setup and maintenance. Passenger also has a reputation for being extremely stable, and its performance is consistent with other Rails application servers.
Phusion Passenger achieves ease of use and low maintenance primarily because it automatically spawns and removes Ruby instances as needed, which makes the production configuration of Passenger significantly simpler than Mongrel. One weakness of the Mongrel setup is that the determination of the optimal number of Mongrel instances for each project is something of a trial-and-error process. Phusion Passenger automates that process for you. If you are using Apache as your web server, integrating Passenger is simple and managed completely within Apache configuration files.
In development, Phusion Passenger keeps all configured Rails applications alive at all times. If you work on multiple Rails projects simultaneously, you’re probably used to having to continually start and stop the servers on those projects. With Phusion Passenger, all the applications are always available, so moving back and forth is much simpler. Because Phusion Passenger manages the Ruby instances, applications that are not being used don’t consume system resources.
Stability is difficult to measure objectively. The Phusion Passenger web site claims that in all their load testing they have never crashed Phusion Passenger because of load (although individual Rails application can still crash because of bugs in the Rails application itself). The consensus experience of Phusion Passenger in the Rails community so far seems to bear this out. Performance appears to be in the same realm as Mongrel—give or take a few percent.