[Mongrel] Comet/Continuations/Armeggedon

Zed Shaw zedshaw at zedshaw.com
Wed Jun 7 01:13:32 EDT 2006

On Tue, 2006-06-06 at 15:17 -0700, Daniel Burkes wrote:
> Hello all-
> Forgive me if this has been discussed before- I searched the archives  
> and didn't see anything.  Anyway, here it goes-
It was brought up in the past, but nothing came of it.

> There is a lot of talk lately about Comet-based applications- that  
> is, web apps that hold connections to the server open for a very long  
> time, to effectively achieve realtime data push from the server to  
> the browser.  Currently, there are a few web servers out there that  
> are specially architected to support this- Twisted and Jetty 6 come  
> to mind.  The problem with those solutions is that neither of them is  
> natively Ruby/Rails- you have to step into Python-land or Java-land  
> there.  What would really be nice is if Mongrel supported long-lived  
> connections by separating the notion of a serviceable request from a  
> thread or process.  That is, be able to suspend a request until it is  
> resumed by some other request, or by timeout, a-la Jetty 6's  
> Continuations (they're really nice!).
I would now like to point you at:


And ask you to read about Ruby Goldberg machines.  The most important
quote being:

"A Rube Goldberg machine or device is any exceedingly complex apparatus
that performs a very simple task in a very indirect and convoluted way."

> Has there been any thought or discussion to adding such a feature to  
> Mongrel?  I realize it probably seems a bit pie-in-the-sky at  
> present, but it could really enable some exciting new types of in- 
> browser applications.  Combined with all the innovation that is going  
> into Rails apps now, it could produce some really thrilling  
> applications.

Well, Ruby has serious serious problems dealing with IO.  Number one
problem is that it uses select so you only get 1024 open files at once.
And that's *all* files, not just sockets.  Throw in lacking performance,
poor IO processing, and only having Strings to do data storage and
you're screwed.

I tried to bring this up in my interview with Pat Eyler at
oreillynet.com and it failed miserably.  Nobody in the Ruby community
seems interested in improving Ruby's speed or scalability.  Rather than
face facts and listen to people like me who are in the trenches dealing
with Ruby's problems, they would rather rant about how nobody really
needs performance.

I'd say, don't even bother until Ruby reaches 2.0 and I've ported over
to Rite/YARV/Whatever.  Until then, trying to do anything that can
handle more than a few persistent connections is just not worth it.

Zed A. Shaw

More information about the Mongrel-users mailing list