in reply to how to find out whats in a LISTEN queue

Before you start testing this you might want to ensure that your kernel supports "large" values for the listen queue. In general, on *nix systems, that limit is set by the kernel in a constant called SOMAXCONN. On (at least some versions of) SUNOS the kernel variable SOMAXCONN is set to 5 and the kernel must be patched/recompiled/relinked to change the value. In the 2.4.19 linux kernel it is defined as 128 -- pretty large.

Also note that you can check to see how much queue is being used by doing netstat -n|grep SYN_RCVD this will show waiting connections. Be sure to only count the ones on the socket in which you are interested, though. (That is, netstat -n|grep SYN_RCVD|wc -l is not enough.) Some linux netstats may not report that value and/or may not document it in the documentation. "Use the source, Luke."

HTH, --traveler

Replies are listed 'Best First'.
Re: Re: how to find out whats in a LISTEN queue
by waswas-fng (Curate) on Jan 03, 2003 at 00:17 UTC
    For systems that arn't running a Dark Ages version of SunOS (Read Solaris) you can set the queue length on a live system with the command:
    /usr/sbin/ndd -set /dev/tcp tcp_conn_req_max <NUM>Solaris 2 -> 2.4 max is really 32, 2.5, 2.5.1 2.6 etc its 1024 and 7 8 9(SunOS 5.7, 5.8 and 5.9) it is 2048.

    If you are Running a version of SunOS you still need to recompile the Kernel (Read SunOS 4.1.3u or earlier) to make these changes you should think about just hiring some monkey to shout ones and zeros at the ethernet port.

    -Waswas
      cool - I do have ndd, on SunOS 5.8 tcp_conn_req_max_q and q0 are 128 and 1024 respectively. It seems that this simple approach still has a chance.

      btw - it seems I havent yet mastered reply replys yet. soon..

Re: Re: how to find out whats in a LISTEN queue
by jimc (Sexton) on Jan 03, 2003 at 00:21 UTC
    yes ! or rather crap !

    I forgot to add that Id looked at netstat -tnee output, but couldnt see anything on Rcv-Q, now I know more.

    looks like I need to do a more complicated application-level handling of the requests, with a callback on completion.

    thx for heading off a fruitless investigation.