why isn't mod ruby used more?

I'm curious. There isn't much talk about it that I can find. Is
there anything in particular that it's lacking?

Chris

Hey Chris-

  Well the main reason its not used more with rails is that you can only run one rails app per apache because mod_ruby embeds one global ruby interpreter for the whole apache. Rails is not coded to deal with this fact so it doesn't work very well. AFAIK there is a patch somewhere that allows multiple rails apps on mod_ruby but it never got much traction.

  I use it for some simple sites with rhtml and rb files but not rails.

-Ezra

"Ezra Zygmuntowicz" wrote

>
> I'm curious. There isn't much talk about it that I can find. Is
> there anything in particular that it's lacking?
>
> Chris

Hey Chris-

Well the main reason its not used more with rails is that you can
only run one rails app per apache because mod_ruby embeds one global
ruby interpreter for the whole apache. Rails is not coded to deal
with this fact so it doesn't work very well. AFAIK there is a patch
somewhere that allows multiple rails apps on mod_ruby but it never
got much traction.

Ezra,

Thanks for the bit of history. Would you know if FastCgi also have this
issue with multiple apps?

Thanks,

Long

No, it doesn't. FCGI is basically a way to do normal CGI, but keep the
interpreters resident between request. Each listener is its own
isolated ruby process.

The reason why Rails doesn't work well with mod_ruby with multiple apps
is that with mod_ruby, each Apache child has its own Ruby process... if
two apps ran under the same apache, the interpreter's namespace would
get hopelessly confused.

Ben

Hello Chris.

Leading edge thinking on deployment has moved away from FastCGI (which
can host more than one application per web server) to towards mongrel,
which can also host more than one application per web server.

mongrel is much easier and natural to setup and test than FastCGI, as
is actively developed by an army of really smart people who have chosen
to name themselves, collectively, Zed Shaw. :slight_smile:

"Ben Bleything" wrote:

> Thanks for the bit of history. Would you know if FastCgi also have this
> issue with multiple apps?

No, it doesn't. FCGI is basically a way to do normal CGI, but keep the
interpreters resident between request. Each listener is its own
isolated ruby process.

The reason why Rails doesn't work well with mod_ruby with multiple apps
is that with mod_ruby, each Apache child has its own Ruby process... if
two apps ran under the same apache, the interpreter's namespace would
get hopelessly confused.

Thanks Ben! This is what I was hoping.

Cheers,

Long

"Tom Mornini" wrote:

> "Ezra Zygmuntowicz" wrote
>>
>>
>>> I'm curious. There isn't much talk about it that I can find. Is
>>> there anything in particular that it's lacking?
>>>
>>> Chris
>>
>> Hey Chris-
>>
>> Well the main reason its not used more with rails is that you can
>> only run one rails app per apache because mod_ruby embeds one global
>> ruby interpreter for the whole apache. Rails is not coded to deal
>> with this fact so it doesn't work very well. AFAIK there is a patch
>> somewhere that allows multiple rails apps on mod_ruby but it never
>> got much traction.
>
> Thanks for the bit of history. Would you know if FastCgi also have
> this
> issue with multiple apps?

Hello Chris.

Leading edge thinking on deployment has moved away from FastCGI (which
can host more than one application per web server) to towards mongrel,
which can also host more than one application per web server.

mongrel is much easier and natural to setup and test than FastCGI, as
is actively developed by an army of really smart people who have chosen
to name themselves, collectively, Zed Shaw. :slight_smile:

I would like to know more about Mongrel. What additional benefits does it have
over FastCGI? Where can I read more about it?

Thanks,

Long

For the leading-edge folks who have moved on from FastCGI: why did you, and for what sort of app? Have you seen http://defendem.com/read/book/1 ?

jeremy

http://mongrel.rubyforge.org/

Perform your own tests with the configuration and decide on what’s best for you. Litespeed web server is also a good option.

Vish

Have you seen http://defendem.com/read/book/1 ?

http://mongrel.rubyforge.org/

Both of these links are good reads. So we have at least two architectures to scale
rails with.

Thanks for the links to both.

Long

Leading edge thinking on deployment has moved away from FastCGI (which
can host more than one application per web server) to towards mongrel,
which can also host more than one application per web server.

For the leading-edge folks who have moved on from FastCGI: why did you

Because it's wonderful to live in an HTTP world. If something gets weird with FCGI, there's no way to "see" what's happening. With mongrel, you can hit mongrel directly with a browser and see what's happening.

All mongrel does is replace the FCGI plumbing with HTTP. Obviously, HTTP is better understood and more tools work with it.

As a good example, imagine you have a performance problem. Is it the front end HTTP server, or your application server? How do you test FCGI without involving the front end HTTP server?

You cannot, of course. With mongrel it's dead simple! You can use the same tools you use to test the whole chain...

and for what sort of app? Have you seen http://defendem.com/read/book/1 ?

I have not seen that, but I have designed Engine Yard, a business critical (Enterprise!) Rails application deployment service, along with Ezra Zygmuntowicz. We have been designing since February, and developing since late July, and I can assure you that mongrel is part of the Engine Yard solution. :slight_smile:

Because it’s wonderful to live in an HTTP world. If something gets
weird with FCGI, there’s no way to “see” what’s happening. With
mongrel, you can hit mongrel directly with a browser and see what’s
happening.

All mongrel does is replace the FCGI plumbing with HTTP. Obviously,
HTTP is better understood and more tools work with it.

As a good example, imagine you have a performance problem. Is it the
front end HTTP server, or your application server? How do you test

FCGI without involving the front end HTTP server?

Definitely. The transparency of HTTP and ease of setup are second to none.

You cannot, of course. With mongrel it’s dead simple! You can use the
same tools you use to test the whole chain…

On the other hand, managing traffic at a high level (HTTP proxy, HTTP protocol) increases response latency and munches CPU like a low level solution does not (TCP balancer, SCGI protocol).

and for what sort of app? Have you seen
http://defendem.com/read/

book/1 ?

I have not seen that, but I have designed Engine Yard, a business
critical (Enterprise!) Rails application deployment service, along
with Ezra Zygmuntowicz. We have been designing since February, and

developing since late July, and I can assure you that mongrel is part
of the Engine Yard solution. :slight_smile:

Rockin. Good luck!

jeremy

Unless I'm completely misunderstanding mod_ruby, it doesn't load an
interpreter per process. If it did I'd be a happy camper. I think it
just instantiates a new class for each request all from the same
interpreter, but I could be way off there.