There is a bunch of hubbub around the Rails community about Passenger (mod_rails). It really simplifies Rails application deployment, but how does it stack up against the venerable Nginx and Mongrel scheme?
My curiosity piqued, I decided to benchmark my current application. All three benchmarks were conducted on Amazon Web Services’ cloud using an Fedora 8 x64 instance with 8G of RAM.
Each instance was tested using Apache’s ‘ab’ tool with 10 concurrent requests over 1000 connections. Each request used authentication and ssl.

As you can see, Nginx with five Mongrel instances is faster than Passenger, and honestly, you can feel some sluggishness using Passenger.
Passenger Pros:
1. Ridiculously easy to install.
2. You don’t have to restart Mongrel processes when you deploy changes to your application.
3. It’s still early in the game, so it can only get faster.
4. Every shared host in the world supports Apache.
Passenger Cons:
1. Noticably sluggish request cycles compared to Nginx/Mongrel
2. Ruby Enterprise Edition doesn’t really seem to do anything
3. Seems to be more of a resource hog than their writeup suggests — I also tested Passenger on an i386 instance with 2G RAM and the damned box nearly melted. Seriously.
Nginx/Mongrel Pros:
1. Faster
2. Nginx is easier to configure than Apache
3. Widely heralded as the current best practice deployment scheme for production environments
Nginx/Mongrel Cons:
1. Comparatively painful to deploy
2. Deploying changes to your application can be trickier
… So my conclusion?
Nginx/Mongrel wins this round. Deployment is much more complex, but also noticably more responsive. Ease of installation is nice, but you only deploy your application from scratch once!
Update – 2009-05-11
This post gets a good amount of traffic, so I’d like to revise my earlier statements: “Just Use Passenger.”






