Owen,

It appears that Solaris 2 defines SOMAXCONN in socket.h as 5.  That's
obviously crap, a holdover from something long ago.

It seems like a Perl fix is in order.  But for now, I would simply
determine it dynamically from ndd, or else code in something safe like the
greater of 128 and SOMAXCONN.  There's no downside, I think the OS will
automatically limit it to the "real" SOMAXCONN regardless of what you ask
for.

David.

-----

On Thu, 26 Feb 2004, Owen McShane wrote:

> Hi David,
>
> Thanks for that.
>
> [EMAIL PROTECTED] said:
> > In Solaris < 2.5.1 or so, this controlled by the ndd tunable 
> > tcp_conn_req_max.
> >   In > 2.5.1, this was split into tcp_conn_req_max_q and tcp_conn_req_max_q0
> > to survive those nasty syn attacks. tcp_conn_req_max_q is the one you want,
> > which refers to "real" queued connections.  I think it defaults to 128 or
> > 1024, depending on what 2.X you are running.  It can be read or retuned
> > realtime as root:
>
> >   ndd -get /dev/tcp tcp_conn_req_max_q
>
> > and -set to change.
>
> I'd already looked into this, and the default value for tcp_conn_req_max_q on 
> Solaris 7 is 128.
>
> > listen() lets one set the actual queue on the particular socket of interest.
> > See man -s3socket listen for the gory details.  If one uses the Perl
> > IO::Socket::INET, the "Listen" parameter allows you to specify the queue up
> > to the max that the kernel is currently running.  The more primitive Socket
> > libraries don't seem to be so kind.  I actually don't know what the default
> > would be in perl in the older libraries.
>
> We have IO::Socket::INET installed.
>
> > Of course, this queue is per socket, not per process listening.  So, if 10
> > forked daemons are listening on a socket for connections, that's not
> > 10*Listen, it's simply Listen for the total number in the queue.
>
> OK, so I guess the question now is:
>
> Will spamd use the value of tcp_conn_req_max_q, thereby giving us a maximum 
> of 10 open sockets, plus a maximum of 128 queued waiting for one to come 
> free, or will it still use the value of SOMAXCONN?
>
> Thanks,
>
> Owen
>
> --
>  Via Net.Works UK Ltd
>  Local Touch Global Reach
>  Owen McShane                 Systems Administrator
>  http://www.vianetworks.co.uk Tel +44 (0)1925 484444
>
>
>

Reply via email to