From: John Pignata <firstname.lastname@example.org> To: email@example.com Subject: Re: Fwd: Queued vs. Active in tcp_stats_listener Date: Sun, 3 Mar 2013 17:26:38 -0500 [thread overview] Message-ID: <CAHzRVjMqKD6TgRsna1Mpc+ayLBRv4OPJAUp3-fDj5jUbLV5Qww@mail.gmail.com> (raw) In-Reply-To: <20130303214613.GA7200@dcvr.yhbt.net> Hi Eric, Thanks for your super-fast and thorough response. On Sun, Mar 3, 2013 at 4:46 PM, Eric Wong <firstname.lastname@example.org> wrote: > 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. Right. I've been talking to Heroku about their overall router behavior. My current understanding is that (on the Cedar stack) the router does not do any intelligent queuing and doesn't apply back-pressure. As requests come in they are passed off to a dyno where they may or may not be enqueued by the application server. https://blog.heroku.com/archives/2013/2/16/routing_performance_update has some good details for any future readers of this thread trying to tune on Heroku. > By backlog, this is the :backlog parameter in the unicorn "listen" > directive, correct? > Yes. > 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. Understood. Though, I'd expect I'd be able to move the queued number with Apache Bench considering the default backlog of 1,024. 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. > Understood. > Can you get around the load balancer and throw traffic at the box > directly? You should see queued counts go up. I cannot on Heroku but I did prop up a Rack test application on an EC2 system and raindrops is behaving the way you're explaining. > unicorn does not accept() connections unless a worker is idle, so > what you're seeing with active == unicorn worker_processes is correct. > Understood. So the queued number should represent connections that (under TCP) have been responded to with an ACK but are enqueued waiting for a worker. I think my issue is with how I'm conducting my test. I may deploy our change to production and monitor it there. We made a similar change to Thin running on Heroku to dump a number to statsd every time a connection occurred and we saw a significant non-zero backlog of connections. I expect to see a smaller but non-zero number under Unicorn. Thanks again for your time and thoughts. -jp
prev parent reply other threads:[~2013-03-03 22:27 UTC|newest] 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 2013-03-03 22:26 ` John Pignata [this message]
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/raindrops/ * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=CAHzRVjMqKD6TgRsna1Mpc+ayLBRv4OPJAUp3-fDj5jUbLV5Qww@mail.gmail.com \ --email@example.com \ --firstname.lastname@example.org \ --subject='Re: Fwd: Queued vs. Active in tcp_stats_listener' \ /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
Code repositories for project(s) associated with this inbox: ../../raindrops.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).