From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS47066 71.19.144.0/20 X-Spam-Status: No, score=-1.9 required=3.0 tests=AWL,BAYES_00, MSGID_FROM_MTA_HEADER shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Eric Wong Newsgroups: gmane.comp.lang.ruby.raindrops.general 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> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1362347195 29834 80.91.229.3 (3 Mar 2013 21:46:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 Mar 2013 21:46:35 +0000 (UTC) To: raindrops@librelist.org Original-X-From: raindrops@librelist.org Sun Mar 03 22:46:57 2013 Return-path: Envelope-to: gclrrg-raindrops@m.gmane.org List-Archive: List-Help: List-Id: List-Post: List-Subscribe: List-Unsubscribe: Precedence: list Original-Sender: raindrops@librelist.org Xref: news.gmane.org gmane.comp.lang.ruby.raindrops.general:102 Archived-At: Received: from zedshaw2.xen.prgmr.com ([71.19.156.177]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UCGkB-0002K4-6V for gclrrg-raindrops@m.gmane.org; Sun, 03 Mar 2013 22:46:55 +0100 Received: from zedshaw2.xen.prgmr.com (unknown [IPv6:::1]) by zedshaw2.xen.prgmr.com (Postfix) with ESMTP id 3592074DFA for ; Sun, 3 Mar 2013 21:47:15 +0000 (UTC) John Pignata 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