Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^5: How to count the number of pending clients in socket queue?

by kschwab (Vicar)
on Nov 18, 2013 at 13:55 UTC ( [id://1063090]=note: print w/replies, xml ) Need Help??


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

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.
  • Comment on Re^5: How to count the number of pending clients in socket queue?

Replies are listed 'Best First'.
Re^6: How to count the number of pending clients in socket queue?
by taint (Chaplain) on Nov 18, 2013 at 14:25 UTC
    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;

      Actually, I think you're right. I checked out morgon's post below, and it looks like "Recv-Q" is overloaded for LISTEN sockets to show the current listenq depth. I experimented a bit and created a server that just listened, and never accept()ed. The number grows with each connected client, and stops growing at whatever you set the listenq size to. Connetions up to listenq size show as "ESTABLISHED", and ones after that show in a SYN-RECV state

      So, at least on linux then, you can use ss, netstat, or the /proc entry morgon pointed out...I was wrong. That said, I still think that spinning up more workers is best done by noting when you're out of them. That will happen before connections pile up on the listenq

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1063090]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-19 09:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found