in reply to Re^2: How to count the number of pending clients in socket queue?
in thread How to count the number of pending clients in socket queue?

No, there's not an easy way to see that. The /proc info, lsof, ss, etc, don't show the current listenq depth. However, there are pretty robust pieces of software that are able to determine when to spin up more theads/instances/processes without using that information. Most of them use the "I'm out of spare workers...they are all busy" condition as the trigger to add more resources..not "work is piling up at the front door" event, which is what the current listenq depth is.

  • Comment on Re^3: How to count the number of pending clients in socket queue?

Replies are listed 'Best First'.
Re^4: How to count the number of pending clients in socket queue?
by taint (Chaplain) on Nov 18, 2013 at 06:46 UTC
    Greetings, kschwab.

    Let me preface the following, by letting you know, I'm not trying to be argumentative. :)

    I should also note; that I'm speaking from a *BSD box. So this might explain differences.

    'nuff said.
    So my experiences seem to be a bit different. For example. My last log entry (somewhat abreviated):

    :8090 tcpflags 0x2<SYN>; tcp_input: Connection attempt to closed port
    Is fairly informative. I can also get pretty detailed information from netstat, and lsof: WAIT, LISTEN, ...

    I cant speak for Linux, or OSX, for that matter (altho OSX uses BSD). But at least on BSD, it seems like I could get that sort of information. I'll look a bit deeper, and see if I can get the kind of output the OP's looking for.

    --Chris

    #!/usr/bin/perl -Tw
    use Perl::Always or die;
    my $perl_version = (5.12.5);
    print $perl_version;
      All interesting info. None of it is the current depth of the listenq. I suppose you could use a kernel debugger and find it, but the current number of "connections waiting for the accept() call" isn't in lsof, /proc, netstat, etc.
        In this case (the OP). There is no argument.

        I did some more investigation, and in doing so. Remembered I had tuned my kernel ( via sysctl) in such a way. That I receive more information, than is normally generated. Frankly, I haven't any idea whether it's even possible on Linux, and am quite sure, unavailable in Windows.
        D'OH!

        ++ to you, kschwab. Apologies for the noise.

        --Chris

        #!/usr/bin/perl -Tw
        use Perl::Always or die;
        my $perl_version = (5.12.5);
        print $perl_version;