Re:How Ravelry Scales to 10 Million Requests Using Rails
by jherdman on Wednesday September 23, 2009 @12:52AM
(#838638)
Wait... they have Nginx out front passing requests to HAProxy and THEN to Apache + mod_rails? That just seems like a bit much given that mod_rails can be installed with Nginx straight up. Why would you want a set up like this?
[ Parent
| on HN ]
Re:How Ravelry Scales to 10 Million Requests Using Rails
by brett on Wednesday September 23, 2009 @01:21AM
(#838681)
Having Nginx in front is a lot more flexible that just having HAProxy listen on port 80. For example, it can serve static files and do redirects both of which don't need to pass through the whole load balanced stack.
They could use Nginx -> HAProxy -> Nginx(w/ passenger), but the Apache version feels slightly more mature (e.g. it has some config options that the Nginx version lacks) and it's likely they were already using it before the Nginx version came out.
Re:How Ravelry Scales to 10 Million Requests Using Rails
by zepolen on Wednesday September 23, 2009 @05:42AM
(#838941)
Why use HAProxy at all?
Re:How Ravelry Scales to 10 Million Requests Using Rails
by lacerus on Wednesday September 23, 2009 @06:08AM
(#838966)
There is an interesting "Zero-Downtime Restarts with HAProxy" Tutorial that he might have implemented:
http://www.igvita.com/2008/12/02/zero-downtime-restarts-with...
Re:How Ravelry Scales to 10 Million Requests Using Rails
by brett on Wednesday September 23, 2009 @01:15PM
(#839655)
It's better at load balancing. For example it handles app servers that have gone down more gracefully. Also it generates an awesome stats page that gives you way more info about what's going on than you can get from Nginx.
Re:How Ravelry Scales to 10 Million Requests Using Rails
by caseyf on Wednesday September 23, 2009 @08:52PM
(#840416)
Yep! We used nginx's fair balancing module before switching to haproxy. It also helps me do rolling restarts/hot deployments in a nice way.
It's really a great piece of software. Kudos to Willy.
PS - you're also correct about the nginx->haproxy->apache. nginx makes a fabulous front end and I just plugged in Apache/Passenger where Mongrel used to be. I like that 1) I can easily plug in something else in the future and 2) Passenger on Apache is very stable. Nginx support is newish and I'm running stripped down Apaches that only do Passenger, so I'm not too fussed about it.