On Jan 22, 2006, at 12:42 PM, Jeff Pritchard wrote:

> Noob question here.
>
I like noobs.  Especially with BBQ sauce.  :-)

> No intent to impugn Zed's mad skilz or the need for something like
> Mongrel.  I'm just confused by why it would be common to develop or
> deploy a ruby on rails app with something other than production  
> servers
> like Apache.
>
Good question.  It really comes down to nothing more than the fastest  
simplest way to serve up a Rails (or Nitro, Camping, IOWA, etc.)  
application.  You've currently got various options:

* CGI -- slow, resource hogging, but works everywhere.
* FastCGI -- Fast, current best practice, a pain in the ass to  
install and real painful for win32 people.
* SCGI -- Fast, pure ruby (runs everywhere Ruby does), works with a  
few servers, very simple to install, use, and cluster, good  
monitoring (warning, I wrote this).
* mod_ruby -- Works but haven't heard of a lot of success with it,  
couples your app to your web server making upgrades difficult.
* WEBrick -- Runs in pure ruby, easy to deploy, you can put it behind  
any web server supporting something like mod_proxy.  Fairly slow.

Now, the sweet spot would be something that was kind of at the  
optimal axis of FastCGI, SCGI, and WEBrick:

* Runs everywhere Ruby does and is easy to install and use.
* Fast as hell with very little overhead above the web app framework.
* Uses plain HTTP so that it can sit behind anything that can proxy  
HTTP.  That's apache, lighttpd, IIS, squid, a huge amount of  
deployment options open up.

This would be where I'm trying to place Mongrel.  It's not intended  
as a replacement for a full web server like Apache, but rather just  
enough web server to run the app frameworks efficiently as backend  
processes.  Based on my work with SCGI (which will inherit some stuff  
from Mongrel soon), it will hopefully meet a niche that's not being  
met right now with the current options.

> So far, all of the rails demos I have seen are using webrick.  This  
> has
> been true even for setups like macosx that come with apache already  
> set
> up and running.
>
> Does apache not come standard with everything needed to serve a rails
> app?  If not, is there an add-on module for apache that makes it
> rails-savvy?
>
Apache or lighttpd are the big ones on Unix systems.  When you get  
over to the win32 camp though lighttpd just don't work, and many  
people insist on using IIS.  In my own experiences, if you can't hook  
it into a portal or Apache without installing any software then  
you're dead.  Sure this is probably an attempt to stop a disruptive  
technology, but if there's a solid fast way to deploy using HTTP then  
that's one more chink in the armor sealed up.

Go talk to someone who's forced to IIS and you'll see why something  
other than WEBrick is really needed.  Actually, WEBrick would be fine  
if it weren't so damn slow.

> Or is it the case that all rails apps have to be served by a special
> rails server like mongrel or webrick?
>
Well, they have to be served by something running Ruby.  I know  
there's people who have tried with mod_ruby, but I haven't heard of a  
lot of success.  I could be wrong on that.  Also, many people don't  
like tightly coupling their applications into their web server.