unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: ghazel@gmail.com
To: unicorn list <mongrel-unicorn@rubyforge.org>
Subject: Re: listen backlog
Date: Thu, 2 Dec 2010 21:31:24 -0800	[thread overview]
Message-ID: <AANLkTim_9Umq+08_SRn8D3HD3=2V4_jsd0nALANWyK07@mail.gmail.com> (raw)
In-Reply-To: <20101203023919.GA4411@dcvr.yhbt.net>

On Thu, Dec 2, 2010 at 6:39 PM, Eric Wong <normalperson@yhbt.net> wrote:
> ghazel@gmail.com wrote:
>> I found this thread
>> http://rubyforge.org/pipermail/mongrel-unicorn/2009-September/000031.html
>> after googling for the same error located in my nginx error log.
>>
>> Is there some way to discover the current queue length of the backlog?
>> Increasing the maximum size to 2048 "worked" for me as well, but
>> obviously clients sit in the queue for a long time. If I could monitor
>> queue length I could get some idea of when I have insufficient unicorn
>> workers before the delay gets very high or requests fail.
>
> If you're using Linux, you can use Raindrops[1] to interrogate
> via inet_diag or parse /proc/net/{tcp,unix} yourself.
>
> You can run Raindrops separate/standalone script:
> http://git.bogomips.org/cgit/raindrops.git/tree/examples/linux-tcp-listener-stats.rb
>
> Or use it as middleware (see webpage):
> http://raindrops.bogomips.org/
>
> git clone git://git.bogomips.org/raindrops

Amazing! I had somehow never heard of it. I use a unix socket for
unicorn (should I not?) so I had to make a copy of
linux-tcp-listener-stats.rb to support that. Now I'm able to get stats
for my unicorn master.

However, there seems to be some problem getting stats on TCP sockets:

$ ruby linux-tcp-listener-stats.rb 127.0.0.1:9000
            address     active     queued
linux-tcp-listener-stats.rb:42:in `tcp_listener_stats': Connection
refused - sendmsg (Errno::ECONNREFUSED)
        from linux-tcp-listener-stats.rb:42
$ grep  0100007F:2328 /proc/net/tcp
   1: 0100007F:2328 00000000:0000 0A 00000000:00000000 00:00000000
00000000   500        0 25307310 1 ffff880134471700 3000 0 0 2 -1

None of the TCP sockets I know to exist seem to work - they all fail
with that error.

Any ideas?

-Greg
_______________________________________________
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-12-03  6:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-03  1:35 listen backlog ghazel
2010-12-03  2:39 ` Eric Wong
2010-12-03  5:31   ` ghazel [this message]
2010-12-03  7:35     ` Eric Wong
2010-12-03  9:16       ` ghazel
2010-12-03 21:49         ` Eric Wong
2010-12-03 22:49           ` ghazel
2010-12-04 23:48             ` Eric Wong
2010-12-05  0:02               ` ghazel

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='AANLkTim_9Umq+08_SRn8D3HD3=2V4_jsd0nALANWyK07@mail.gmail.com' \
    --to=ghazel@gmail.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).