Phusion white papers Phusion overview

Phusion Blog

Phusion Passenger™ 2.0 RC 1 and Ruby Enterprise Edition released

By Hongli Lai on June 9th, 2008

It’s a little bit late (this should have been done during RailsConf, sorry), but it’s finally here. We’re pleased to announce Phusion Passenger 2.0, release candidate 1. 😀 If no major issues are found, this will become version 2.0.1. We’re also pleased to announce the long-awaited Ruby Enterprise Edition.

RailsConf 2008 presentation

Our RailsConf 2008 presentation about Phusion Passenger and Ruby Enterprise Edition went extremely well. The sheets are available in the following formats:

The presentation includes a screencast (23 MB) created by Soocial.

Some people have been distributing our old, outdated sheets, which contain lots and lots of bullet points and almost no graphics. Please download the sheets on this page instead: these are the sheets that we used during the presentation.

Introducing Rack support

2 months after the release of Phusion Passenger 1.0, we present you with Rack support. It is now possible to host arbitrary Ruby web applications (e.g. Merb and Camping) on Phusion Passenger! We provide this feature with the same ease of use that many people have come to love.

The following screencast, created by Ryan Bates of RailsCasts fame, demonstrates the ease of deploying a Rack application on Phusion Passenger:

But that’s not all. We’ve done our homework. Our Users guide provides a comprehensive list of Rackup specifications for all Ruby web frameworks that we could find, so that you don’t have to hunt this information down yourself!

We received some Rack-related contributions shortly after Rack support had been pushed to the public git repository. We’d like to thank _why and remi for contributing documentation and full Rackup DSL support.

Introduction Python WSGI support

Not only do we support Rack, we now also support Python WSGI! In theory, Phusion Passenger can now run Django.

Don’t get us wrong. Phusion Passenger’s main focus is still on Ruby and Ruby on Rails. WSGI support is meant to be a show case of Phusion Passenger’s flexible architecture.

Optimizations

Much better stability
This new release is much more stable than the 1.0.x series. Many stability issues have been fixed. In fact, Dreamhost and iLike are using this version in production environments. So if you were experiencing stability problems, please upgrade to this version, as it may solve your problem.
Much faster graceful restart
Some hosts gracefully restart Apache often, so to them, high graceful restart speed is essential. Phusion Passenger 2.0 RC 1 is much, much faster at graceful restarts.
Less memory usage: reduced VM size

Process monitoring tools tend to use the “VM size” of a process as an indication of the actual memory usage. This is not correct, because the VM size only indicates the amount of memory that a process can access, not the amount of memory that it actually uses.

Nevertheless, having a large VM size poses problems. Some servers, virtual private servers in particular, have artificial VM size limits in order to prevent processes from using too much memory. Phusion Passenger 1.0 makes Apache’s VM size very large (more than 100 MB), even though the actual memory usage is only several MB.

In Phusion Passenger 2.0, the VM size has been reduced by ten fold, as shown by the following diagram:

Fair load balancing (as opposed to round-robin load balancing)

One of the traditional problems of Mongrel Cluster behind Nginx is, in Ezra‘s words:

“My only complaint was that the proxy modue was round robin only. This means that if you had 3 mongrels and one of them performed and action that took say 20 seconds, for that 20 seconds every 3rd request would get stuck in line behind the mongrel doing the long blocking request. This is because nginx was merrily doing round robin and didn’t care if a mongrel was busy or not.”

Phusion Passenger now supports fair load balancing. It will forward a request to the Rails instance with the least number of requests in its queue. Fair load balancing is turned on by default, without the need to configure anything.

See also page 53 of the presentation sheets.

Upload buffering

In Phusion Passenger 1.0, a (long) file upload will block a Rails application instance. Usually this is not a big problem, because Phusion Passenger will spawn more Rails instances if existing ones are blocked. But it becomes a problem if your website handles many simultaneous file uploads (read: more than 10 concurrent file uploads at any time).

Phusion Passenger 2.0 supports upload buffering. File uploads that are sufficiently large, are stored into a temporary file. Only when the file upload is done, will it be forwarded to the Rails application. This means that your Rails applications will not be blocked while a large file upload is in progress.


See slide 86 of the presentation sheets.

Default timeouts changed, in favor of virtual private servers

The default timeout values in Phusion Passenger 1.0 were optimized for shared hosts, which host many applications and need to free resources quickly. But most of our users seem to be using virtual private servers. These servers usually don’t get a lot of traffic, so the default timeouts are easily reached. So we’ve changed the default timeout values in favor of virtual private servers. Shared hosts and people running Phusion Passenger on dedicated servers should adjust the timeouts.

What Default in Phusion Passenger 1.0 Default in Phusion Passenger 2.0
RailsMaxPoolSize 20 6
RailsPoolIdleTime 120 300
ApplicationSpawner server idle time 120 600

Other improvements

Ruby on Rails 1.0 compatibility
Phusion Passenger is now compatible with Rails 1.0 applications as well.
Improved application compatibility: conservative spawning

By default, Phusion Passenger preloads the Ruby on Rails framework and application code. This allows Phusion Passenger to reduce the startup time of Ruby on Rails applications and to save memory. Using this technique, startup time can be decreased by as much as 90%!

Unfortunately, some applications and/or plugins don’t expect to be preloaded, and even assumes that no code is being preloaded. soap4r is one such plugin. Until recently, these applications/plugins didn’t work with Phusion Passenger.

Phusion Passenger 2.0 implements so-called conservative spawning. In conservative spawning mode, Phusion Passenger will not preload any code. In other words, it will emulate the way Mongrel loads Rails applications. Conservative spawning allows Phusion Passenger to be 100% compatible with all Rails applications.

Conservative spawning is less efficient than the default spawning strategy, though no less efficient than Mongrel Cluster. You should only use conservative spawning if you’re experiencing compatibility problems.

‘RailsEnv’ is now per-virtual host
The RailsEnv configuration option used to be a global option. It’s now a per-virtual host option, so you can define a different environment for every Rails application.
New resource control option: ‘PassengerMaxInstancesPerApp’

The PassengerMaxInstancesPerApp option allows you to define the maximum number of pool slots that a single application may use. This will prevent a single application from getting out of control and taking over the entire server.

Many thanks to Jochen Tuchbreiter for contributing this feature.

Support for worker MPM
The Apache worker MPM is now supported.
Analysis and system maintenance tools
Phusion Passenger 2.0 includes new analysis and system maintenance tools. If you’re experiencing stability problems with Phusion Passenger or your Rails application, then please try these tools.

How do I upgrade to 2.0 RC 1?

Via a gem

Please download the 2.0 RC 1 gem, then install it with the command:

gem install passenger-1.9.0.gem

Next, run:

passenger-install-apache2-module

Please don’t forget to copy & paste the Apache config snippet that the installer gives you.

Via a native Linux package

Neil Wilson from Brightbox has kindly provided an Ubuntu 8.04 package for Phusion Passenger. The package is available from the Brightbox repository which you can find at:

http://apt.brightbox.net

Add the following line to the Third Party Software Sources:

deb http://apt.brightbox.net hardy main

(The simplest way to do that is to create a file in /etc/apt/sources.list.d/ containing the deb anstruction, and then run ‘apt-get update‘).

Once you’ve done this then you can install Phusion Passenger by running:

apt-get install libapache2-mod-passenger

Finally, run the following command. This will tell you how to configure Apache.

passenger-install-apache2-module

Ruby Enterprise Edition

Ruby Enterprise Edition has been officially launched. Check out http://www.rubyenterpriseedition.com/

So far, Ruby Enterprise Edition has mostly been tested on Linux (both 32-bit and 64-bit). MacOS X is not yet supported: support for it is planned for a future version.

That’s all folks

A lot of work has been put into this release. Enjoy. 🙂 If you like our work, please consider getting an “enterprise license”. 😉