raindrops RubyGem user+dev discussion/patches/pulls/bugs/help
 help / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: raindrops@librelist.org
Subject: Re: Fwd: Queued vs. Active in tcp_stats_listener
Date: Sun, 3 Mar 2013 21:46:13 +0000
Message-ID: <20130303214613.GA7200@dcvr.yhbt.net> (raw)
In-Reply-To: <CAHzRVjPo99FD8Hby9ws=Tv56CvA_gZw-BMkn+zmxF2Gc1+nNSw@mail.gmail.com>

John Pignata <john@pignata.com> wrote:
> Hi all,
> 
> I'm attempting to use Raindrops in order to start instrumenting our Unicorn
> workloads on Heroku using statsd. I'm a little confused at the numbers it
> reports under test.

I'm not sure what Heroku does, but I think they have some fancy load
balancer/router.  Maybe that limits the number of connection it opens to
the (virtual?) machine unicorn runs on.

You should ask Heroku if they do this.

> My primary confusion is that our active number never climbs above the
> number of workers we have running. Since we have a large backlog, I

By backlog, this is the :backlog parameter in the unicorn "listen"
directive, correct?

This :backlog parameter is only a hint to the kernel to limit the maximum
queue size.  If the kernel never sees many connections in the first place,
the limit will never be hit.

> expected to see the total number of accept()'ed clients counted in this
> number too. Unfortunately, I only spikes up to the total number of workers
> and queued never spikes above 0. I expected the latter as we shouldn't ever
> be refusing connections with our large backlog.

The "queued" in raindrops is the connections the kernel TCP stack knows
about.  If your load balancer doesn't send requests, the TCP stack in
the kernel won't see them.

Can you get around the load balancer and throw traffic at the box
directly?  You should see queued counts go up.

> If active represents the number of requests that are currently being
> serviced and queued represents the number of connections that have yet to
> be accept()'ed, is there a way to get out the middle state: requests that
> have been accept()'ed but not yet started?

unicorn does not accept() connections unless a worker is idle[1], so
what you're seeing with active == unicorn worker_processes is correct.


[1] - this is the crux of unicorn: one client per worker process;
      there's never any queueing/head-of-queue blocking in userspace


  reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAHzRVjNOLb+UeNx4EGrUPbjdLkpku0Ppkbo4VU8c1260N-QhiA@mail.gmail.com>
2013-03-03 21:09 ` John Pignata
2013-03-03 21:46   ` Eric Wong [this message]
2013-03-03 22:26     ` John Pignata

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://bogomips.org/raindrops/

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

  git send-email \
    --in-reply-to=20130303214613.GA7200@dcvr.yhbt.net \
    --to=normalperson@yhbt.net \
    --cc=raindrops@librelist.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

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

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

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.lang.ruby.raindrops
	nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.raindrops

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

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