Phusion Passenger 4.0.58 released
We’ve just released version 4.0.58 of the Phusion Passenger application server for Ruby, Python and Node.js. This release fixes two minor packaging-related issues.
Debian packages no longer require Ruby 1.9
Due to a bug in the package specifications, Debian packages used to require Ruby 1.9, even if you already have newer Ruby versions installed from APT (e.g. through the Brightbox repository). This bug has now been fixed. The Phusion Passenger Debian packages now require some Ruby interpreter, but it doesn’t care which version.
Enterprise: fixed Flying Passenger in the Debian packages
Phusion Passenger Enterprise’s Flying Passenger mode was broken in the Debian packages. It wouldn’t work if you try to use it with a Ruby interpreter that isn’t installed by APT. This has been fixed.
Installing or upgrading to 4.0.58
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Final
Phusion Passenger’s core is open source. PleaseIf you would like to stay up to date with Phusion news, please fill in your name and email address below and sign up for our newsletter. We won’t spam you, we promise.
Phusion Passenger 4.0.57: better Ruby 2.2 support, Nginx 1.7.9 support
We’ve just released version 4.0.57 of the Phusion Passenger application server for Ruby, Python and Node.js. This release fixes two minor but important issues.
Phusion Passenger 4 is the current stable branch, in which we release bug fixes from time to time. At the same time there is also Phusion Passenger 5, which is the not-yet-ready-for-production development branch, with major changes and improvements and terms of performance application behavior visibility. Version 5.0 beta 3 will soon be released, but until the 5.x branch is considered stable, we will keep releasing bug fixes under the 4.x branch.
Phusion Passenger also has an Enterprise version which comes with a wide array of additional features. By buying Phusion Passenger Enterprise you will directly sponsor the development of the open source version.
Improved Ruby 2.2 support
Version 4.0.56 already introduced Ruby 2.2 support, but due to an issue in the way we compile the Phusion Passenger native extension, it didn’t work with all Ruby 2.2 installations. In particular, 4.0.56 worked with Ruby 2.2 installations that were compiled with a shared libruby, which is the case if you installed Ruby 2.2 with RVM or though operating system packages. But it did not work with Ruby 2.2 installations that were compiled with a static libruby, which is the case if you installed manually from source, or using rbenv and chruby, or when you are using Heroku.
At first, we suspected a bug in Ruby 2.2’s build system, but after feedback from the MRI core developers, it turned out to be an issue in our own build system. The issue is caused by a commit from 4 years ago, GH-168, which attempted to fix a different issue. It seems there is no way to fix Ruby 2.2 compatibility while at the same time fixing GH-168, so we had to make a choice. Since GH-168 is quite old and was made at a time when Ruby 1.8.6 was the latest Ruby version, we believe that the issue is no longer relevant. We reverted GH-168 in favor of Ruby 2.2 compatibility.
Many thanks to the different users who have supplied feedback. You can read the discussions at the Github issue tracker.
Nginx 1.7.9 support
Nginx 1.7.9 was released a while ago and changed its internal API yet again. 4.0.57 fixes compatibility with Ngixn 1.7.9.
Installing or upgrading to 4.0.57
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Final
Phusion Passenger’s core is open source. PleaseIf you would like to stay up to date with Phusion news, please fill in your name and email address below and sign up for our newsletter. We won’t spam you, we promise.
Phusion Passenger 4.0.56: facepalming at file descriptor leak, Node.js load balancing
We’ve just released version 4.0.56 of the Phusion Passenger application server for Ruby, Python and Node.js, which fixes a number of interesting and important bugs. They’re the kind of typical bugs that make me go “what the **** was I thinking?!” after I’ve analyzed them, because the fixes are very simple.
Leaking file descriptors
The first bug is a file descriptor leak. A file descriptor is number which represents a kernel resource, such as an open file or a socket. Every time you call File.open
or TCPSocket.new
in Ruby, you get an IO object that’s internally backed by a file descriptor. In Node.js you even often work with file descriptors directly: most fs
functions return a file descriptor. Since Phusion Passenger is written in C++, we also work with file descriptors directly.
Schematically, it looks like this:
You’re probably familiar with memory leaks. A file descriptor leak is very similar. If you ever lose track of a file descriptor number, you’ve leaked it. In Ruby this is not possible because all IO objects own their file descriptor, and IO objects are garbage collected (thus closing the corresponding file descriptor). However in Node.js and in C++ this can easily happen if you’re not careful. When leaked, the kernel resource stays allocated until your process exits.
What went wrong
In Passenger, we leaked a file descriptor when creating an error report file. This file is created if your app can’t spawn for some reason (e.g. it throws an exception during startup). The code that was responsible for rendering the file looked like this, in semi C++ pseudocode:
void processAndLogNewSpawnException(SpawnException &e) {
int fd = -1;
FdGuard guard(fd);
fd = createNewReportFile();
if (fd != -1) {
renderReportFileContents(fd, e);
}
}
Notice the guard
variable. In C++, it is a so-called RAII object: “Resource Acquisition Is Initialization”. It is a common coding pattern in C++ to ensure that things are cleaned up when exceptions are thrown, kind of like the C++ equivalent of the ensure
keyword in Ruby or the finally
keyword in Javascript. When this function exits for any reason, be it a normal return or an exception, the guard
destructor is called, which is supposed to close the file descriptor.
The facepalm moment was when Paul “popox” B reported that the guard was on the wrong line. The guard was created before the file descriptor was assigned to fd
, so the guard did nothing all this time. Every time a report file was created, a file descriptor was leaked.
The one-line fix
The solution was to move the guard object a little bit:
void processAndLogNewSpawnException(SpawnException &e) {
int fd = -1;
// Guard object was here
fd = createNewReportFile();
// It is now here
FdGuard guard(fd);
if (fd != -1) {
renderReportFileContents(fd, e);
}
}
Thank you Paul B!
Node.js load balancing
The other issue fixed in 4.0.56 is a Node.js load balancing issue. In Passenger we load balance requests between application processes as much as possible. Traditionally, the reason for load balancing has been to minimize latency. This utilizes the concept of “application concurrency”: the maximum number of concurrent requests a single app process can handle. For Ruby apps, the concurrency is 1 (unless you configured multithreading, in which case the concurrency is equal to the number of threads). Since Ruby apps have finite I/O concurrency, Passenger load balances a request to a different process only if one process has run out of concurrency.
Node.js is different in that it’s fully asynchronous. It can effectively have an unlimited amount of concurrency.
Passenger orders processes in a priority queue by “busyness”. Load balancing is achieved by routing a new request to the process with the least busyness.
What went wrong
What went wrong with the Node.js case is the fact that we had special rules for application processes with unlimited concurrency. The busyness for such processes is calculated as follows:
if (sessions == 0) {
return 0;
} else {
return 1;
}
sessions
indicates the number of requests that a process is currently handling. This piece of code effectively sorted Node.js processes in two categories only: idle processes and non-idle processes.
From a concurrency point of view, there is nothing wrong with this. Node.js apps have unlimited concurrency after all. However this resulted in lots of requests “sticking” to a few processes, as Charles Vallières reported:
* PID: 24526 Sessions: 84 Processed: 1 Uptime: 9s
* PID: 24545 Sessions: 1 Processed: 0 Uptime: 9s
* PID: 24571 Sessions: 83 Processed: 0 Uptime: 8s
* PID: 24596 Sessions: 1 Processed: 0 Uptime: 8s
Then it dawned to me that I forgot something. An even distribution of requests is desirable here, because now the reason for load balancing becomes different. It’s to maximize CPU core usage, because single Node.js process can only use 1 CPU core.
The fix
The fix was incredibly easy:
return sessions;
Yes, facepalm time.
Thank you Charles Vallières!
Installing or upgrading to 4.0.56
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Final
Phusion Passenger’s core is open source. PleaseIf you would like to stay up to date with Phusion news, please fill in your name and email address below and sign up for our newsletter. We won’t spam you, we promise.
Phusion Passenger 4.0.55 released, supports Ruby 2.2
Phusion Passenger is a fast and robust web server and application server for Ruby, Python, Node.js and Meteor. Passenger takes a lot of complexity out of deploying web apps, and adds powerful enterprise-grade features that are useful in production. High-profile companies such as Apple, New York Times, AirBnB, Juniper, American Express, etc are already using it, as well as over 350.000 websites.
Phusion Passenger is under constant maintenance and development. Version 4.0.55 is a bugfix release.
Phusion Passenger also has an Enterprise version which comes with a wide array of additional features. By buying Phusion Passenger Enterprise you will directly sponsor the development of the open source version.
Recent changes
Version 4.0.54 has been skipped because it was a hotfix for Enterprise customers. The changes in 4.0.54 and 4.0.55 combined are as follows:
- Supports Ruby 2.2. Ruby 2.2 isn’t released yet and only exists as an alpha, but we’re supporting it anyway. Closes GH-1314.
- Fixed Linux OS name detection.
- Contains a licensing-related hot fix for Enterprise customers.
Installing or upgrading to 4.0.55
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Final
Phusion Passenger’s core is open source. PleaseIf you would like to stay up to date with Phusion news, please fill in your name and email address below and sign up for our newsletter. We won’t spam you, we promise.
Phusion Passenger 4.0.53 released
Phusion Passenger is a fast and robust web server and application server for Ruby, Python, Node.js and Meteor. Passenger takes a lot of complexity out of deploying web apps, and adds powerful enterprise-grade features that are useful in production. High-profile companies such as Apple, New York Times, AirBnB, Juniper, American Express, etc are already using it, as well as over 350.000 websites.
Phusion Passenger is under constant maintenance and development. Version 4.0.53 is a bugfix release.
Phusion Passenger also has an Enterprise version which comes with a wide array of additional features. By buying Phusion Passenger Enterprise you will directly sponsor the development of the open source version.
Recent changes
- Upgraded the preferred Nginx version to 1.6.2.
- Improved RVM gemset autodetection.
- Fixed some Ruby 2.2 compatibility issues.
Installing or upgrading to 4.0.53
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Final
Phusion Passenger’s core is open source. PleaseIf you would like to stay up to date with Phusion news, please fill in your name and email address below and sign up for our newsletter. We won’t spam you, we promise.
Phusion Passenger 4.0.52 released
Phusion Passenger is a fast and robust web server and application server for Ruby, Python, Node.js and Meteor. Passenger takes a lot of complexity out of deploying web apps, and adds powerful enterprise-grade features that are useful in production. High-profile companies such as Apple, New York Times, AirBnB, Juniper, American Express, etc are already using it, as well as over 350.000 websites.
Phusion Passenger is under constant maintenance and development. Version 4.0.52 is a bugfix release.
Phusion Passenger also has an Enterprise version which comes with a wide array of additional features. By buying Phusion Passenger Enterprise you will directly sponsor the development of the open source version.
Recent changes
Version 4.0.50 and 4.0.51 have been skipped because they were hotfixes for Enterprise customers. The changes in 4.0.50, 4.0.51 and 4.0.52 combined are as follows:
- Fixed a null termination bug when autodetecting application types.
- Node.js apps can now also trigger the inverse port binding mechanism by passing
'/passenger'
as argument. This was introduced in order to be able to support the Hapi.js framework. Please read this StackOverflow answer for more information regarding Hapi.js support. - It is now possible to abort Node.js WebSocket connections upon application restart. Please refer to this page for more information. Closes GH-1200.
- Passenger Standalone no longer automatically resolves symlinks in its paths.
passenger-config system-metrics
no longer crashes when the system clock is set to a time in the past. Closes GH-1276.passenger-status
,passenger-memory-stats
,passenger-install-apache2-module
andpassenger-install-nginx-module
no longer output ANSI color codes by default when STDOUT is not a TTY. Closes GH-487.passenger-install-nginx-module --auto
is now all that’s necessary to make it fully non-interactive. It is no longer necessary to provide all the answers through command line parameters. Closes GH-852.- Minor contribution by Alessandro Lenzen.
- Fixed a potential heap corruption bug.
- Added Union Station support for Rails 4.1.
Installing or upgrading to 4.0.52
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Final
Phusion Passenger’s core is open source. PleaseIf you would like to stay up to date with Phusion news, please fill in your name and email address below and sign up for our newsletter. We won’t spam you, we promise.
Phusion Passenger 4.0.49 released
Phusion Passenger is a fast and robust web server and application server for Ruby, Python, Node.js and Meteor. Passenger takes a lot of complexity out of deploying web apps, and adds powerful enterprise-grade features that are useful in production. High-profile companies such as Apple, New York Times, AirBnB, Juniper, American Express, etc are already using it, as well as over 350.000 websites.
Phusion Passenger is under constant maintenance and development. Version 4.0.49 is a bugfix release.
Phusion Passenger also has an Enterprise version which comes with a wide array of additional features. By buying Phusion Passenger Enterprise you will directly sponsor the development of the open source version.
Recent changes
- Upgraded the preferred Nginx version to 1.6.1.
- Fixed a crash that may be triggered by the
passenger_max_requests
feature. - Introduced the
spawn_failed
hook, which is called when an application process fails to spawn. You could use this hook to setup an error notification system. Closes GH-1252. - Fonts, RSS and XML are now gzip-compressed by default in Phusion Passenger Standalone. Thanks to Jacob Elder. Closes GH-1254.
- Fixed some user and group information lookup issues. Closes GH-1253.
- Fixed some request handling crashes. Closes GH-1250.
- Fixed some compilation problems on Gentoo. Closes GH-1261.
- Fixed some compilation problems on Solaris. Closes GH-1260.
Installing or upgrading to 4.0.49
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Final
Phusion Passenger’s core is open source. PleaseIf you would like to stay up to date with Phusion news, please fill in your name and email address below and sign up for our newsletter. We won’t spam you, we promise.
Phusion Passenger 4.0.48 released
Phusion Passenger is a fast and robust web server and application server for Ruby, Python, Node.js and Meteor. Passenger takes a lot of complexity out of deploying web apps, and adds powerful enterprise-grade features that are useful in production. High-profile companies such as Apple, New York Times, AirBnB, Juniper, American Express, etc are already using it, as well as over 350.000 websites.
Phusion Passenger is under constant maintenance and development. Version 4.0.48 is a bugfix release.
Phusion Passenger also has an Enterprise version which comes with a wide array of additional features. By buying Phusion Passenger Enterprise you will directly sponsor the development of the open source version.
Recent changes
4.0.47 was a hotfix release for an Enterprise customer. The changes in 4.0.47 and 4.0.48 combined are as follows.
- Fixed a race condition while determining what user an application should be executed as. This bug could lead to applications being run as the wrong user. Closes GH-1241.
- [Standalone] Improved autodetection of Rails asset pipeline files. This prevents Standalone from incorrectly setting caching headers on non-asset pipeline files. Closes GH-1225.
- Fixed compilation problems on CentOS 5. Thanks to J. Smith. Closes GH-1247.
- Fixed compilation problems on OpenBSD.
- Fixed compatibility with Ruby 1.8.5.
Installing or upgrading to 4.0.48
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Final
Phusion Passenger’s core is open source. PleaseIf you would like to stay up to date with Phusion news, please fill in your name and email address below and sign up for our newsletter. We won’t spam you, we promise.
Phusion Passenger 4.0.46 released
Phusion Passenger is a fast and robust web server and application server for Ruby, Python, Node.js and Meteor. Passenger takes a lot of complexity out of deploying web apps, and adds powerful enterprise-grade features that are useful in production. High-profile companies such as Apple, New York Times, AirBnB, Juniper, American Express, etc are already using it, as well as over 350.000 websites.
Phusion Passenger is under constant maintenance and development. Version 4.0.46 is a bugfix release.
Phusion Passenger also has an Enterprise version which comes with a wide array of additional features. By buying Phusion Passenger Enterprise you will directly sponsor the development of the open source version.
Recent changes
Most notable changes:
- Further improved Node.js and Socket.io compatibility.
- Sticky session cookies have been made more reliable.
- Fixed WebSocket upgrade issues on Firefox. Closes GH-1232.
- Improved Python compatibility.
- Logging of application spawning errors has been much improved. Full details
about the error, such as environment variables, are saved to a private log file.
In the past, these details were only viewable in the browser. This change also
fixes a bug on Phusion Passenger Enterprise, where enabling Deployment Error
Resistance causes error messages to get lost. Closes GH-1021 and GH-1175. - Passenger Standalone no longer, by default, loads shell startup files before
loading the application. This is because Passenger Standalone is often invoked
from the shell anyway. Indeed, loading shell startup files again can interfere
with any environment variables already set in the invoking shell. You can
still tell Passenger Standalone to load shell startup files by passing
--load-shell-envvars
. Passenger for Apache and Passenger for Nginx still
load shell startup files by default. - If you are a Union Station customer, then
Phusion Passenger will now also log application spawning errors to Union Station.
This data isn’t shown in the Union Station interface yet, but it will be
implemented in the future.
Minor changes:
- The Python application loader now inserts the application root into
sys.path
.
The fact that this was not done previously caused a lot of confusion amongst
Python users, who wondered why theirpassenger_wsgi.py
could not import any
modules from the same directory. - Fixed a compatibility problem with Django, which could cause Django apps to
freeze indefinitely. Closes GH-1215. - Fixed a regression in Node.js support. When a Node.js app is deployed on
a HTTPS host, theX-Forwarded-Proto
header wasn’t set in 4.0.45.
Closes GH-1231. - Passenger Standalone now works properly when the HOME environment variable
isn’t set. Closes GH-713. - Passenger Standalone’s
package-runtime
command has been removed. It has
been broken for a while and has nowadays been obsolete by our automatic
binary generation system.
Closes GH-1133. - The
passenger_startup_file
option now also works on Python apps. Closes GH-1233. - Fixed compilation problems on OmniOS and OpenIndiana. Closes GH-1212.
- Fixed compilation problems when Nginx is configured with OpenResty.
Thanks to Yichun Zhang. Closes GH-1226. - Fixed Nginx HTTP POST failures on ARM platforms. Thanks to nocelic for the fix.
Closes GH-1151. - Documentation contributions by Tim Bishop and Tugdual de Kerviler.
- Minor Nginx bug fix by Feng Gu. Closes GH-1235.
Installing or upgrading to 4.0.46
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Final
Phusion Passenger’s core is open source. PleaseIf you would like to stay up to date with Phusion news, please fill in your name and email address below and sign up for our newsletter. We won’t spam you, we promise.
Phusion Passenger 4.0.45: major Node.js and Meteor compatibility improvements
Phusion Passenger is a fast and robust web server and application server for Ruby, Python, Node.js and Meteor. Passenger takes a lot of complexity out of deploying web apps, and adds powerful enterprise-grade features that are useful in production. High-profile companies such as Apple, New York Times, AirBnB, Juniper, American Express, etc are already using it, as well as over 350.000 websites.
Phusion Passenger is under constant maintenance and development. Version 4.0.45 is a bugfix release.
Phusion Passenger also has an Enterprise version which comes with a wide array of additional features. By buying Phusion Passenger Enterprise you will directly sponsor the development of the open source version.
Recent changes
- Major improvements in Node.js and Meteor compatibility. Older Phusion Passenger versions implemented Node.js support by emulating Node.js’ HTTP library. This approach was found to be unsustainable, so we’ve abandoned that approach and replaced it with a much simpler approach that does not involve emulating the HTTP library.
- Introduced support for sticky sessions. Sticky sessions are useful — or even required — for apps that store state inside process memory. Prominent examples include SockJS, Socket.io, faye-websocket and Meteor. Sticky sessions are required to make the aforementioned examples work in multi-process scenarios. By introducing sticky sessions support, we’ve much improved WebSocket support and support for the aforementioned libraries and frameworks.
- Due to user demand, GET requests with request bodies are once again supported. Support for these kinds of requests was removed in 4.0.42 in an attempt to increase the strictness and robustness of our request handling code. It has been determined that GET requests with request bodies can be adequately supported without degrading robustness in Phusion Passenger. However, GET requests with both request bodies and WebSocket upgrade headers are unsupported. Fixes issue #1092.
- [Enterprise] The Flying Passenger feature is now also available on Apache.
- Fixed some issues with RVM mixed mode support, issue #1121.
- Fixed Passenger Standalone complaining about not finding PassengerHelperAgent during startup.
- Fixed various minor issues such as #1190 and #1197.
- The download timeout for passenger-install-nginx-module has been increased. Patch by 亀田 義裕.
Installing or upgrading to 4.0.45
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Final
Phusion Passenger’s core is open source. PleaseIf you would like to stay up to date with Phusion news, please fill in your name and email address below and sign up for our newsletter. We won’t spam you, we promise.