views:

1140

answers:

7

I read from some books that Phusion Passenger is the answer to easy Ruby on Rails deployment. But my friend said that first there was Apache + bunch of Mongrels, and then lighttpd, and then nginx, and now Passenger, and it seems endless...

he also said he uses dreamhost which uses Passenger, and sometimes he sees his request not being processed.

So I wonder if Passenger is the final answer to RoR deployment? do you use it and used the "ab" command to test if the site is doing quite well?

+16  A: 

short answer: yes.

long answer: yeeeeeeeeeeeeeeesssssssssssssssss.

In all seriousness, Phusion Passenger and Ruby Enterprise Edition have taken out pretty much all of the pain of moving a Rails app into production. Previous approaches, including running a suite of Mongrels, required lots of setup surrounding starting, stopping, and recycling listener processes that Passenger handles transparently, or via simple Apache (or nginx) configuration options. And REE's complementary garbage collector means that forking off a new listener uses MUCH less memory, and is faster to boot (in Passenger's "smart" spawning mode).

Edit: @srboisvert makes a very good point; Passenger isn't the final answer to RoR deployment, but for now it's my favorite by far. One day, after a lot of hard engineering problems are solved, mainstream Ruby will probably move from hosting RoR using a multi-process model to a single-process model, which would make management even easier than with Passenger.

John Douthat
+1 for long answer: yeeeeeeeeeeeeeeesssssssssssssssss. I have burst into laughters and am still laughing.
Comptrol
+3  A: 

Yes, it is the easiest, fastest and most efficient solution. After a lot of problems with gems like soap4r etc. had been resolved in recent releases, Passenger is the answer to deployment questions now.

We're running Apache/mod_rails in a balanced environment with HAProxy in front of 2 servers. It's much more reliable than our previous setup using Mongrel/Aapache.

It's very easy to take control over

  • the amount of Passenger processes running in Apache
  • the amount of Passenger processes running per application
  • and all that without the pain of tweaking a number of config files like mod_proxy, Apache.
  • setting up a virtual host and adding 3 lines to your Apache config is basically enough to get it running

Matt

Matt
+2  A: 

Final Answer? Nothing is ever the final answer.

I'd say Passenger is the current answer though.

srboisvert
nothing is the final answer unless you are playing the game of "who's want to be a millionaire".
動靜能量
+4  A: 

It's the best solution so far. I started deploying with FCGI and it was a pain. Then came mongrel and it was better. Then came mod_rails and it was WAY better.

Also a lot of large cool application are migrating to mod_rails including some by 37signals, so you know that's good.

I'll just end with a quote from DHH:

The one-piece solution with Phusion Passenger

Once you've completed the incredibly simple installation, you get an Apache that acts as both web server, load balancer, application server and process watcher. You simply drop in your application and touch tmp/restart.txt when you want to bounce it and bam, you're up and running.

But somehow the message of Passenger has been a little slow to sink in. There's already a ton of big sites running off it. Including Shopify, MTV, Geni, Yammer, and we'll be moving over first Ta-da List shortly, then hopefully the rest of the 37signals suite quickly thereafter.

So while there are still reasons to run your own custom multi-tier setup of manually configured pieces, just like there are people shying away from mod_php for their particulars, I think we've finally settled on a default answer. Something that doesn't require you to really think about the first deployment of your Rails application. Something that just works out of the box. Even if that box is a shared host!

In conclusion, Rails is no longer hard to deploy. Phusion Passenger has made it ridiculously easy.

(via)

marcgg
+1  A: 

I guess that now people will stick to mod_rails for many years. The module is really good. Configuration is dead simple. It will be hard to replace it with some better solution. Similar to mod_php. The only key component which is missing: Windows port.

Greg Dan
+2  A: 

Yes. I've been running Nginx/Passenger in front of Apache for whatever still needs PHP since they released 2.2.0 a few weeks back. Especially with Ruby Enterprise Edition, it approaches what I would call "perfect".

Burke
A: 

In some situations (enterprise, etc) the JVM can also be a good option.

Sam