views:

37

answers:

1

Hi,

This is probably the silliest question today but...

The Rails team & many others recommend using passenger instead of a mongrel cluster, but I cannot find a clear list of exact benefits / advantages of this or what the potential pitfall are. Just wondering if anyone can help explain this?

Also is passenger its own server or does it use mongrel under the hood?

Thanks!

+4  A: 

Before Passenger, Mongrel was the way to go, but a Mongrel cluster can be a nuisance to keep properly tuned. As your application grows in complexity, the memory footprint of each Mongrel instance will expand, and this can eat into available disk cache and degrade performance, so you'll have to pay close attention to the memory allocation balance on your deployments. From time to time you'll have to tweak it to add or remove Mongrels.

The other downside is you'll need to manage these Mongrel processes using some kind of launcher like monit and these can be fussy and difficult. Mongrel does not come with its own process manager.

Another serious problem is that each Mongrel is locked to a particular application and shifting loads between one app and another is very difficult to manage.

Mongrel is also dependent on an external load-balancer that you must configure yourself.

Passenger will handle launching all the Rails engine processes and will do its best to allocate memory efficiently. If you have a number of sites with conflicting priorities, Passenger will do a good job of launching servers on demand, and pruning them off when they're not used.

Passenger is also very quick to relaunch all instances of an application by looking for the tmp/restart.txt trigger file. You don't have to kill any processes or wait for a restart.

Under the hood, Passenger uses its own launcher and dispatch system. Although functionally it is similar to Mongrel, there are a number of significant performance improvements that Phusion has introduced that make Passenger significantly more memory-efficient than Mongrel.

Passenger is a complete package that just works and is surprisingly easy to manage. Mongrel is only a very basic web server.

tadman
Good comparison, tadman! Are there any benefits to mongrel, or downsides to passenger?
raidfive
Mongrel is easier to launch for quick testing (script/server), and Passenger needs a second or two to "warm up" after a long period of inactivity, though usually you don't notice. Passenger is completely integrated with Apache and nginx, it's just so much better.
tadman