unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Jamie Wilkinson <jamie@tramchase.com>
To: unicorn list <mongrel-unicorn@rubyforge.org>
Subject: Re: scaling unicorn
Date: Tue, 22 Jun 2010 11:57:58 -0700	[thread overview]
Message-ID: <9A7FCF99-DE2A-4D7F-A8ED-5B9302BD4B11@tramchase.com> (raw)
In-Reply-To: <AANLkTilWNicXuA0N5ouCvt3Pt1Wl0Fu9PEX_GQApzQn4@mail.gmail.com>

>> Somewhat related -- I've been meaning to discuss the finer points of
>> backlog tuning.
>> 
>> I've been experimenting with the multi-server socket+TCP megaunicorn
>> configuration from your CDT:
>> http://rubyforge.org/pipermail/mongrel-unicorn/2009-September/000033.html

On Jun 22, 2010, at 11:03 AM, snacktime wrote:

> Seems like you would have some type of 'reserve'
> cluster for requests that hit the listen backlog, and when you start
> seeing too much traffic going to the reserve, you add more servers to
> your main pool.  How else would you manage the configuration for
> something like this when you are working with 100 - 200 servers?  You
> can't be changing the nginx configs every time you add servers, that's
> just not practical.

We are using chef for machine configuration which makes these kinds of  numbers doable
http://wiki.opscode.com/display/chef/Home

I would love to see a nginx module for distributed configuration mgmnt

Right now we are running 6 frontend machines, 4 in use & 2 in reserve like you described. We are doing about 5000rpm with this, almost all dynamic. 10-30% of requests might be 'slow' (1+s) depending on usage patterns. 

To measure health I am using munin to watch system load, nginx requests & nginx errors. In this configuration 502 Bad Gateways from frontend nginx indicate a busy unicorn socket & thus a handoff of the request to the backups. Then we measure the rails production.log for request counts + speed on each server as well as using NewRelic RPM

monit also emails us when 502s show up. 
In theory monit could  be automatically spinning up another backup server, provisioning it using chef, then reprovisioning the rest of the cluster to start handing over traffic. Alternately the new server could just act as backup for the one overloaded machine, which could make isolating performance issues easier.

-jamie

_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying


  reply	other threads:[~2010-06-22 18:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AANLkTilv4e_DPDKy440xotrlE7ucFIFXs74uHyGrzCKL@mail.gmail.com>
2010-06-22  0:16 ` [Mongrel] scaling unicorn Eric Wong
2010-06-22  2:34   ` Jamie Wilkinson
2010-06-22  4:53     ` Eric Wong
2010-06-22 18:03       ` snacktime
2010-06-22 18:57         ` Jamie Wilkinson [this message]
2010-06-23  9:32         ` Eric Wong
2010-06-22 19:18       ` Jamie Wilkinson
2010-06-22 17:30   ` [Mongrel] " snacktime

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://yhbt.net/unicorn/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9A7FCF99-DE2A-4D7F-A8ED-5B9302BD4B11@tramchase.com \
    --to=jamie@tramchase.com \
    --cc=mongrel-unicorn@rubyforge.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).