Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 09 Mar 2001 09:59:38 +0100 (MET)
From:      dada@sbox.tugraz.at
To:        freebsd-net@freebsd.org
Cc:        mkamm@gmx.net
Subject:   backlog of listen(2)
Message-ID:  <984128378.3aa89b7ab728f@sbox.tugraz.at>

next in thread | raw e-mail | index | archive | help
Just curious:
I noticed that FreeBSD and NetBSD will give you a 50% longer listen queue
than what was requested with the second argument of listen(2). (You get
trunc(N*3/2)+1 for backlog=N). Thus with the default SOMAXCONN of 128 (this
is settable with a sysctl) we actually have a listen queue of 193 connections.
(OpenBSD dropped the "divide by two" and gives you 200% more than requested.)
Obviously this doesn´t break anything - it has been this way at least since
BSD 4.4 Lite - but it makes me curious. Does anybody know why this was 
implemented other than it is documented?
Btw, Linux counts exactly (gives 2*N+1) but since 2.2 only completed
connections are counted.

TIA,
  Martin
 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?984128378.3aa89b7ab728f>