raindrops RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: raindrops@librelist.com
Subject: Re: queued is always 0
Date: Mon, 28 Jun 2010 17:50:07 -0700
Message-ID: <20100629005007.GA25438@dcvr.yhbt.net> (raw)
In-Reply-To: <AANLkTin_Q6ATwr39uwEs78j2LcydIu622tBz85vAHArf@mail.gmail.com>

Ryan King <ryan@twitter.com> wrote:
> I'm trying to see if raindrops will help us instrument our stack, so
> I'm doing some tests.
> I have 16 unicorns running our app with rainbows and am hitting it
> with ab with a concurrency of 100. However, according to
> linux-tcp-listener-stats.rb I have 0 queued requests. Maybe I'm
> missing something, but shouldn't there be queued requests somewhere
> here?

Hi Ryan,

The Unicorns could be accept()-ing connections fast enough and the
queued connections aren't noticeable[1].

Try sending SIGWINCH to the Unicorn master process and they
should be queueing up because all the workers will have stopped.
(SIGHUP to restart the workers).

You can test and walk through this yourself on IRB, too:

1. startup irb: "irb -rsocket", then inside irb:

   server = TCPServer.new '', 3000

2. Now, hit the address you started the server on in a different
   terminal with curl:

     curl -v  # curl should block here

3. Run linux-tcp-listener-stats:

    # You should see one queued, zero active

4. Back in irb, accept the connection:

   client = server.accept # should get a TCPSocket object

5. Run linux-tcp-listener-stats again:

    # You should see one active, zero queued

If you fire up more curl instances in other terminals without
running "server.accept" in IRB, you should see more queued.

Let me know how it goes for you.

[1] - On a side note, Unicorn is very aggressive about accepting
      connections, it speculatively tries to accept() after each
      application dispatch (which could've taken a long time)
      instead of running select() on the listen socket first.

Eric Wong

  reply index

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-29  0:26 Ryan King
2010-06-29  0:50 ` Eric Wong [this message]
2010-06-30  1:12   ` Ryan King
2010-06-30  2:45     ` Eric Wong
2010-06-30 18:51       ` Ryan King
2010-06-30 23:18         ` Ryan King
2010-07-01 10:18         ` Eric Wong
2010-07-01 18:37           ` Ryan King
2010-07-02  2:51             ` Eric Wong

Reply instructions:

You may reply publically 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:

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

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

  git send-email \
    --in-reply-to=20100629005007.GA25438@dcvr.yhbt.net \
    --to=normalperson@yhbt.net \
    --cc=raindrops@librelist.com \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

raindrops RubyGem user+dev discussion/patches/pulls/bugs/help

Archives are clonable:
	git clone --mirror https://yhbt.net/raindrops-public
	git clone --mirror http://ou63pmih66umazou.onion/raindrops-public

Example config snippet for mirrors

Newsgroups are available over NNTP:

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git