Rob Sanheim
2/4/2007 5:25:00 AM
On 2/3/07, M. Edward (Ed) Borasky <znmeb@cesmail.net> wrote:
> Daniel DeLorme wrote:
> > ara.t.howard@noaa.gov wrote:
> >> you realize that this is __exactly__ what running rails, or any cgi,
> >> under
> >> fastcgi does right?
> >
> > No, fastcgi creates a bunch of worker processes and loads the full
> > rails environment in EACH of them. That means a lot of memory (30+ MB
> > for each process) and a long initialization time (2+ seconds for each
> > process).
> >
> > What I'm talking about is loading the large environment once and THEN
> > forking off worker processes that don't need to go through the
> > expensive initialization sequence. It seems like an obvious idea and
> > rails is not the only framework with a large footprint, so *someone*
> > must have done something like this already.
> >
> > Daniel
> >
> >
> What about Mongrel? Isn't that the "fastest" web server for Ruby? How
> does Mongrel's memory footprint compare with the others?
>
> Incidentally, speaking of fast web servers, how much can be gained (on a
> Linux platform, of course) in a Rails server with Mongrel and Apache by
> using Tux? Zed, any idea?
>
> --
Mongrel will use up plenty of memory, generally around 30 megs per
mongrel to start. That will grow with your app, of course. Most
people who have limited memory go with a much leaner web server then
apache, but mongrel is still the preferred choice for serving Rails.
I'm not sure how the OP imagines these child processes would work -
Rails doesn't really have any sort of threading model where it could
hand out work to the child processes. A lot of Rails isn't even
threadsafe AFAIK. Thats why all the current deployment recipes have
one full rails environment per mongrel instance/fastcgi process.
Rob