Engine Yard Bounty Pays Off

Posted by glenn gillen on Wednesday, November 21, 2007

Posted in ruby on rails, nginx, deployment


Engine Yard, the current big daddy of rails hosting, decided to put a bounty out to solve a problem all the newly converted rails/nginx users would have to some degree but have previously been ignoring. The load balancer in nginx works in a round robin fashion meaning that any long running request has the potential to cause another user to queue behind it, rather than getting served by one of the free and waiting mongrels. Well wait no more!

Take a look at Ezra’s blog for the most definitive run down on how to get it working for you, but the digest version goes a little something like this.

Download the optional module tarball from nginx fair proxy balancer and then do the following:


cd nginx.git
./configure—with-http_ssl_module
make
sudo make install

Now that you’ve compiled with the new module all that is left to update your upstream nginx.conf to include the fair directive:


upstream mongrel {
    fair;
    server 127.0.0.1:3000;
    server 127.0.0.1:3001;
    server 127.0.0.1:3002;
  }

Bookmark

Add to: Digg Add to: Del.icio.us Add to: Reddit Add to: StumbleUpon Add to: Slashdot Add to: Yahoo Add to: Google Add to: Blogmarks Add to: Technorati Add to: Newsvine Add to: Netvouz
blog comments powered by Disqus