[Mongrel] Most reliable setup for mongrel

Rod Ebrahimi rodebrahimi at gmail.com
Fri Jan 26 02:29:12 EST 2007


Hi Chris,
  The optimal solution depends on the resources you have available to
you. Assuming you would like to accomplish your objectives "on a
shoestring" I would recommend looking into, as Ezra suggested, HAProxy
(HAProxy does not support SSL). HAProxy knows how to be smart about
what's going on in the backend. I have configured HAProxy in front of
nginx web/application servers with mongrels. If the requested server
is not available, the request is handled by an available server.

HAProxy->(nginx/mongrels)->db

[ load balancer->app servers->db servers ]

To add to Ezra's suggestion, please keep in mind that HAProxy does not
support SSL. I use Pound to handle SSL requests, routing them to the
appropriate web/application servers.

Add to that virtualization and you have a scalable solution on a shoestring ;)

PS: Thanks Zed for your excellent work on mongrel.

Best,
Rod

On 1/25/07, Ezra Zygmuntowicz <ezmobius at gmail.com> wrote:
>
> On Jan 25, 2007, at 10:24 PM, snacktime wrote:
>
> > I'm looking for the most reliable setup for Mongrel.  Reliable meaning
> > avoiding things like sending too many requests to a single mongrel
> > process, or sending requests to a mongrel process that has hung for
> > some reason.  The handler will most likely be rails, but it might be a
> > custom handler.  SSL is also a requirement, which limits the options a
> > bit but it can't be done away with.
> >
> > I spent some time looking at using the proxy balancer in apache, and
> > it appears that the balancer can pile up requests on mongrel because
> > there is no way to tell apache to not send more than one request at a
> > time to any single balance member.  I'm also not sure how well things
> > are handled if a mongrel process hangs in some way.  Not that it would
> > of course:)
> >
> > Suggestions?
> >
> > Chris
>
>
> Chris-
>
>         Haproxy is a software proxy that can do the right thing and not
> overload mongrels. But it is not a webserver. I have used it behind
> nginx. So nginx or apache proxy to one haproxy and then haproxy does
> the load balancing in a more inteligent way then apapche ro nginx can
> do right now.
>
>         But Igor the author of nginx said that he will be adding a max-load
> to the ngixn proxy module which you could set to one and then ngxin
> would queue requests instead of mongrel and only send requests to
> mongrels that are not busy. This will be the best option with the
> least moving parts once he adds this feature.
>
> Cheers-
> -- Ezra Zygmuntowicz
> -- Lead Rails Evangelist
> -- ez at engineyard.com
> -- Engine Yard, Serious Rails Hosting
> -- (866) 518-YARD (9273)
>
>
> _______________________________________________
> Mongrel-users mailing list
> Mongrel-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-users
>


More information about the Mongrel-users mailing list