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

On Sep 23, 2006, at 11:40 PM, snacktime 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.

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

-Ezra

On Sun, Sep 24, 2006, Long 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.

Ben

“Ezra Z.” wrote

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

On Sep 24, 2006, at 9:34 AM, Long wrote:

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 S… :slight_smile:


– Tom M.

“Ben B.” wrote:

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

On 9/24/06, Tom M. [email protected] wrote:

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,
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

“Tom M.” wrote:

Chris
Thanks for the bit of history. Would you know if FastCgi also have
is actively developed by an army of really smart people who have chosen
to name themselves, collectively, Zed S… :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

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

On 9/24/06, Tom M. [email protected] wrote:

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 Y., a business
critical (Enterprise!) Rails application deployment service, along
with Ezra Z… We have been designing since February, and
developing since late July, and I can assure you that mongrel is part
of the Engine Y. solution. :slight_smile:

Rockin. Good luck!

jeremy

I believe another issue with mod_ruby is that since it requires every
apache process to have a ruby interpreter and your app loaded, memory
footprint increases in an often unecessary way (eg we have ~ 8 fcgi
(soon mongrels) running and average 30-40 httpd’s running so if we had
to load ruby into all of those things that would be an extra 30
interpreters, easily 600 megs of RAM)).

Fred

On Sep 24, 2006, at 12:24 PM, Jeremy K. wrote:

On 9/24/06, Tom M. [email protected] wrote:

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 Y., a business
critical (Enterprise!) Rails application deployment service, along
with Ezra Z… We have been designing since February, and
developing since late July, and I can assure you that mongrel is part
of the Engine Y. solution. :slight_smile:


– Tom M.

On 9/26/06, Fred [email protected] wrote:

I believe another issue with mod_ruby is that since it requires every
apache process to have a ruby interpreter and your app loaded, memory
footprint increases in an often unecessary way (eg we have ~ 8 fcgi
(soon mongrels) running and average 30-40 httpd’s running so if we had
to load ruby into all of those things that would be an extra 30
interpreters, easily 600 megs of RAM)).

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.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs