Phusion Passenger 2.2.2 released

By Hongli Lai April 26th, 2009

Phusion Passenger is an Apache and Nginx module for deploying Ruby on Rails web applications, and is mainly focused on ease of use and stability.

Recent changes

Phusion Passenger is under constant maintenance and development. We are pleased to announce Phusion Passenger version 2.2.2. This is a bug fix release.

The following things have changed since 2.2.1:

Nginx/Apache: Rack 1.0.0 support
We now support the Rack 1.0 specification. If you were experiencing any Rack-related problems then please upgrade to Phusion Passenger 2.2.2. Issue #279.

Please note that Rails edge have a few Rack-related bugs. We submitted some patches, which are currently being reviewed: http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2564-acrequestcontent_type-should-return-a-string

Nginx: SSL fixes
In the Nginx version, calling request.ssl? in Rails returned false even on SSL hosts. This has been fixed: issue #264.
Nginx: PATH_INFO is now set correctly
The Nginx version didn’t set PATH_INFO correctly. Rails and Merb were unaffected because they use REQUEST_URI, but Rails Metal and Sinatra, and possibly other frameworks as well, were affected. Issue #260.
Nginx: support for graceful restart
A graceful restart used to leave junk processes behind. This has been fixed: issue #255.
Nginx: ensure that the response line contains an HTTP reason phrase
If the backend application didn’t sent a reason phrase (e.g. the “OK” part of “200 OK”) then the response sent by Nginx won’t contain a reason phrase as well. This breaks Ajax requests on Internet Explorer, and probably some other browsers as well. Phusion Passenger will now add a reason phrase if the original response didn’t contain one. Issue #278.
Nginx: fixed a crash in passenger-install-nginx-module if the user specified a custom config file location
If the user specified a custom config file location by passing –conf-file to the Nginx configure script, the passenger-nginx-module will crash. This has been fixed: issue #272.
Nginx: fixed a crash that occurs if the last header is an empty string
If the last header value that Nginx internally passes to the backend application is an empty string, then this would cause a crash in the backend application. This problem has been fixed.
Nginx/Apache: proper support for fork()
In previous versions of Phusion Passenger, if one forks() a child process without calling exec() as well, then Phusion Passenger won’t finish the request cycle until the child process has exited. This has been fixed: the child process won’t block the request cycle even if it doesn’t call exec().

Note that the Spawn plugin attempted to fix this issue, but their fix doesn’t work for Rails 2.3. We’ve notified the author of the Spawn plugin about the fact that their fix is not necessary on Phusion Passenger 2.2.2 and later. Users who use the Spawn plugin are advised to upgrade to Phusion Passenger 2.2.2 and the latest version of the Spawn plugin.

Nginx/Apache: fixed some problems on OS X
  • Some compilation problems have been fixed.
  • passenger-memory-stats: fixed display of process command lines.
Nginx/Apache: The Rakefile is now parallelizable
Future versions of Rake may support invoking tasks in parallel with the -j command line argument, just like make. This can potentially speed up compilation. We’ve updated the Rakefile in preparation for this future Rake feature.
Nginx/Apache: documentation updates
A few errors in the documentation have been fixed. The Rackup specification for Ramaze has been updated.

How do I upgrade to 2.2.2?

Via a gem

Please install it with the following command:

gem install passenger

Next, run:

passenger-install-apache2-module

Or, if you’re an Nginx user:

passenger-install-nginx-module

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

Via a native Linux package

John Leach 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 instruction, and then run ‘apt-get update’).

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

sudo apt-get install libapache2-mod-passenger

-or-

sudo apt-get install nginx-brightbox

(Note that John is currently packaging 2.2.2, so it might take a while before this release shows up in the apt repository.)

Final

Phusion Passenger is provided to the community for free. If you like Phusion Passenger, please consider sending us a donation. Thank you!

Hongli Lai Ninh Bui

Phusion Passenger | Comments (9)

Ruby Enterprise Edition 1.8.6-20090421 released

By Hongli Lai April 22nd, 2009

What is Ruby Enterprise Edition?

Ruby Enterprise Edition (REE) is a server-oriented distribution of the official Ruby interpreter, and includes various additional enhancements, such as:

REE has been out for about a year now and is already used by many high-profile websites and organizations, such as New York Times, Shopify and 37signals.

“We switched to enterprise ruby to get the full benefit of the [copy-on-write] memory characteristics and we can absolutely confirm the memory savings of 30% some others have reported. This is many thousand dollars of savings even at today’s hardware prices.”
Tobias Lütke (Shopify)

And just like Phusion Passenger, Ruby Enterprise Edition is 100% open source.

Changes

Now based on Ruby 1.8.6-p287
The previous REE released was based on Ruby 1.8.6-p286. This one is based on p287, which fixes a few bugs in the ‘dl’ library.

Unfortunately there wasn’t enough time to base REE on Ruby 1.8.6-p368, which was released last week. This is planned for a future version.

Fixed a possible infinite looping bug in the garbage collector
A long-standing, but rare, infinite looping bug in the garbage collector has been fixed. If you’ve ever seen Ruby Enterprise Edition freezing while using 100% CPU, then that’s probably this bug. This bug only occurs under very rare circumstances involving deferred running of finalizers.

Users are strongly advised to upgrade to this release for this bug fix alone.

Upgraded to tcmalloc 1.2
The tcmalloc memory allocator has been upgraded from version 0.99.6 to 1.2, which is slightly faster and has support for more platforms.
Upgraded to RubyGems 1.3.2
If you’ve ever seen an error message in Phusion Passenger along the lines of “Directory ‘/nonexistent’ not found”, then what you’ve seen is a bug in RubyGems 1.3.1. This bug has been fixed in RubyGems 1.3.2.
Included Sparc optimization patches
Darryl Gove’s and Miriam Blatt’s Sparc optimization patches are now included. It has been reported that these patches make Ruby significantly faster and more stable on Sparc machines.
OpenSSL extension compilation on Gentoo fixed
The Ruby OpenSSL extension didn’t compile correctly on Gentoo. This issue has been fixed by applying a patch by the Gentoo developers.
Installer improvements
  • The installer now supports command line arguments for disabling the automatic installation of gems and for passing arguments to the Ruby configure script. The latter is useful for enabling –enable-shared, which is required for some libraries such as RubyCocoa.
  • Some Solaris compilation problems have been fixed. Patch by Dana Contreras.
  • The CC, CFLAGS and LDFLAGS environment variables are now respected by the installer itself as well. Patch by Dana Contreras.
Documentation improvements
Evan Weaver has recently published the garbage collector tuning settings used by Twitter. These settings have been included in the documentation along with the 37signals settings.

In our tests, the Twitter settings result in a 12% performance improvement at the cost of a higher memory usage.

64-bit Ubuntu package
We now also provide an x86_64 Ubuntu package.

Download & upgrade

To install Ruby Enterprise Edition, please visit the download page. To upgrade from a previous version, simply install into the same prefix that you installed to last time. Please also refer to the documentation for upgrade instructions.

Hongli Lai Ninh Bui

Ruby Enterprise Edition | Comments (8)

Phusion Passenger 2.2.1 released

By Hongli Lai April 18th, 2009

It has only been two days since the initial release of Phusion Passenger for Nginx, and it has already exceeded our wildest expectations. Only minutes after publishing the announcement, hundreds of people visited our blog. Our bandwidth usage skyrocketed and was heavily utilized for quite some time. There were hundreds upon hundreds of tweets. Thank you all for your enthusiasm! :)

CPU usage Bandwidth usage

Shortly after the release, the first bug reports came in. Some people were having compilation problems. We know that many of you are eager to try Phusion Passenger for Nginx, and we don’t want to keep you waiting, so we’ve made it a priority to get this bugfix release out of the door as soon as possible.

Today, we proudly present Phusion Passenger 2.2.1! The changes are as follows:

  • Fixed compilation errors caused by warnings. Some people on 64-bit Linux platforms might experience this. Issue #249.
  • Fixed http_rewrite_module support. The installer was supposed to only deactivate it if PCRE is not installed, because rewrite_module depends on PCRE. Because of a typo it disabled rewrite_module even if PCRE is installed. Fixes issue #251.
  • Fixed Nginx 0.7 support. Issue #252.
    Phusion Passenger 2.2.0 actually supports an older version of Nginx 0.7, but it seems that recent Nginx releases broke it again. The 0.7 series of Nginx is changing rapidly, so we’ve decided to only support the latest version of the 0.7 series.
    So if you’re running Nginx 0.7.x, and Phusion Passenger doesn’t compile correctly, then please check whether you’re running the latest version of the 0.7 series.

How do I upgrade to 2.2.1?

Via a gem

Please install it with the following command:

gem install passenger

Next, run:

passenger-install-apache2-module

or

passenger-install-nginx-module

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

Via a native Linux package

John Leach 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 instruction, 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

Final

If you like our work, please recommend us on Working With Rails.

Hongli Lai Ninh Bui

Phusion Passenger | Comments (9)

Phusion’s One Year Anniversary Gift: Phusion Passenger 2.2.0

By Ninh Bui April 16th, 2009

This month is a very special month for Phusion. Not only was it one year ago that we posted our ideas on getting Ruby to work on all PHP platforms (RAHP) as an April fools joke, but it was also the month that Hongli and I officially founded Phusion, the Computer Science company at the Dutch chamber of commerce. Needless to say, seeing as this is Phusion’s first year anniversary as a company, we felt strongly inclined to go the extra mile and make this one count. Instead of making yet another April fools joke, we wanted to take the opportunity to announce a long-awaited addition to our Phusion Passenger line-up. In a way, I guess the joke would be that this really isn’t a joke. :-D

We are glad to announce…

Phusion Passenger for Nginx

Ever since the first release of Phusion Passenger for Apache, some people have been asking us to create a Phusion Passenger for platform XYZ. Well, it may come to you as no surprise but we’ve been playing with similar ideas for quite some time. In fact, we’ve architected Phusion Passenger to be as independent from any specific web server as possible to make something like this an option to consider to begin with.

For us however, maintaining a product to live up to the high quality standards that you’ve come to expect of our products requires a lot of time and effort. Maintaining multiple versions of a project won’t exactly lower this amount of required effort and with limited resources in mind, this made us a bit reluctant on doing something like this from the start. Instead, we chose to focus our efforts on polishing up one version before ever deciding to make the jump to another server platform, a choice from which we’d be able to reap the fruits from in tenfold. Not only in terms of experience, but also in terms of having a more robust and solid code base to work from.

Even though we would be able to share a lot of code between different server versions from an architectural point of view, this would only be a small benefit compared to the work that would still be required. Not only would a fair deal of specific code need to be written but also maintained and documented. This process in particular is painful if the server software you’re writing it for doesn’t have any documentation itself, which became all too apparent for us in some particular cases.

Despite being able to successfully create several versions, we weren’t able to infer significant benefits over the Apache version, both from a technical point of view as well as from an ease of use point of view. In fact, in past articles we’ve elaborated on both points quite a deal and had decided not to pursue its release in favor of polishing the core foundations of Phusion Passenger first and foremost. However, reasons like these usually only play a small part in the choice of technology. Company policies and dependencies of other software usually play a bigger part in deciding this, and with this in mind, Apache might not always be an option. In this regard, we’ve always wanted to accommodate the largest denominator and it is for this reason that the initial version of Phusion Passenger and the ones that followed were exclusively for Apache. Until today that is.

A few weeks ago, as you may still remember from the comments in this article, Ezra of Engine Yard contacted us on the possibility of financially sponsoring a first release of Phusion Passenger for Nginx. Even though we had already written the majority of the code for Nginx Passenger quite a few months ago, we didn’t feel it was the right time to release it back then.

By the time of this writing however, Phusion Passenger is almost one year old and as mature as it has ever been thanks to all the contributions people have made during this time. With this in mind, we decided to accept Ezra’s offer.

After spending weeks on further development and intensive testing, we’ve now come to the point wherein we have the distinct honor to announce Phusion Passenger for Nginx as an addition to the Phusion Passenger server line-up.. Our thanks goes out to Engine Yard for financially sponsoring this first release of Phusion Passenger for Nginx, as well as all the people who have in some way donated in the past for making this release possible in the first place.

Great, how do I get started?

Geoffrey Grosenbach of Peepcode fame has kindly created a screencast for us. This screencast covers everything you need to get started with deploying a Rails/Ruby web application on Nginx using Phusion Passenger.

Nginx screencast by Geoffrey Grosenbach

In a nutshell, you first need to install the Phusion Passenger gem:

sudo gem install passenger

(Note: Rubyforge might still be updating their mirrors. If the above command didn’t install 2.2.0 for you and you can’t wait, then download the 2.2.0 gem from Google Code)

Both the Apache and the Nginx version are contained in the same gem, which keeps things nice and simple!

Next, you need to run the passenger-install-nginx-module command, similar to what you’re used to when installing the Apache version:

sudo passenger-install-nginx-module

Nginx doesn’t support loadable modules like Apache does, so it needs to be compiled from scratch. But the installer can do this for you as well! You can of course also choose to compile Nginx manually. Once Nginx has been compiled and installed, the installer will tell you how to configure Nginx and how to deploy a Rails application on Nginx. A typical deploy server bock looks like this:

server {
    listen 80;
    server_name www.foo.com;
    root /webapps/foo/public;   # <--- notice the 'public' part
    passenger_enabled on;       # <--- don't forget this!
}

We've also spent a lot of effort on documenting Phusion Passenger for Nginx. For detailed installation instructions and usage instructions, please refer to the users guide for Nginx.

If you prefer to install Phusion Passenger via the source tarball instead, then that's also possible. Please read the included README for installation instructions.

Where to report bugs

If you've found a bug, please do not post it in a comment, but file an issue on our issue tracker instead.

Other changes

In addition to bringing you an Nginx version of Phusion Passenger, we've also made improvements in the Apache version. The most important changes are:

Support for chunked file uploads
Resource-limited HTTP clients, such as mobile devices, often send HTTP file uploads using the "chunked" transfer encoding in order to save resources. Previous versions of Phusion Passenger didn't support this, but now it does! Please note that chunked file uploads is only supported in the Apache version; the Nginx version doesn't because doesn't support chunked file uploads.
Support for Capistrano-style deployments
Whenever you deploy a new release with Capistrano, previous versions of Phusion Passenger will leave the application processes of the last release running until they idle timeout. This includes the old release's ApplicationSpawner server process. This is caused by the fact that Phusion Passenger uniquely identifies an application based on its canonical path, meaning that any symlinks in the paths are fully resolved. In Capistrano-style deployments, the 'current' directory is actually a symlink to a release directory, so every time you deploy a new release, Phusion Passenger thinks that it's a totally different application.

This issue has now been fixed, and Phusion Passenger no longer resolves symlinks anymore. So whenever you deploy a new release with Capistrano, Phusion Passenger will properly detect it as being the same application. If you had any hacks in your deploy.rb for killing off old processes, then you can remove them now!

Ability to load application_controller.rb from non-standard directory
In some applications, application_controller.rb is located in the search path, though not in app/controllers. Support for this kind of setup has been fixed.
Worker process event hooks for Rack
The :starting_worker_process and :stopping_worker_process event hooks have been implemented for Rack as well. Thanks to Saimon Moore.

Some final words

We initially planned to announce this release at the coming Railsconf, but the temptation was just too big to announce this on our very first anniversary. Also, if all goes as scheduled, we may have an even bigger announcement at Railsconf, so stay tuned! ;) Follow us on Twitter too to stay in the loop ( @phusion_nl )

Phusion Passenger | Comments (99)

Blog downtime

By Hongli Lai April 3rd, 2009

Because of an issue with our (now former) hosting provider, our blog and several of our websites had been down for more than a day. We were able to restore the blog posts, but unfortunately we lost several weeks worth of blog comments.

Our apologies for any inconvenience that this may have caused.

General | Comments (0)