Subject: Re: New sysctl "net.listen_backlog"?
To: Jonathan Stone <jonathan@DSG.Stanford.EDU>
From: Todd Vierling <>
List: tech-net
Date: 09/14/1998 19:46:00
On Mon, 14 Sep 1998, Jonathan Stone wrote:

: >I am going on what Todd said; ie. that SOMAXCONN is set to 5 in
: >sys/socket.h; I don't use or track NetBSD very closely. 

: SOMAXCONN is 128 in 1.3.2, both in sys/socket.h and the manpage.  I
: haven't looked further back, but I think it was 128 in 1.3 as well,
: and it's still 128 in yesterday's source.
: Could you please post your adjusted opinions, given that?

I didn't realize it had been increased at all.  Frankly, I liked your
earlier opinion of having SOMAXCONN reflect the hard limit that the sysctl
can be set to, as listen() will truncate to fit as necessary anyway.  There
isn't really a reason to make the value of SOMAXCONN dynamic, because of the
"shrink to fit" behavior.

The default shouldn't be as high as 128, IMHO.  If this was increased to
make the relevant server people happy, it should be brought back down to 16
or so once a knob is in place because of what I describe below.

: Other than that, I still don't see the problem with just using 128,
: though.  Todd?  Is there one?

Actually, yes.  I have in my repertoire an underpowered box who really needs
a lower limit if only to protect itself from a major DOS attack via the
classic "open a lot of connections to make it spawn lots of children from
inetd."  On the flip side, I also have a production web server that needs it
increased to about 200 at times.

Hence, a knob (which already exists on most other modern Un*ces) is quite

-- Todd Vierling (Personal; Bus.