From owner-freebsd-net Fri Mar 9 0:59:48 2001 Delivered-To: freebsd-net@freebsd.org Received: from sbox.tugraz.at (fstgss05.tu-graz.ac.at [129.27.3.24]) by hub.freebsd.org (Postfix) with ESMTP id BEE8E37B720 for ; Fri, 9 Mar 2001 00:59:43 -0800 (PST) (envelope-from dada@sbox.tugraz.at) Received: (from cyrus@localhost) by sbox.tugraz.at (8.11.3/8.11.3) id f298xcG19120; Fri, 9 Mar 2001 09:59:38 +0100 (MET) From: dada@sbox.tugraz.at To: freebsd-net@freebsd.org Subject: backlog of listen(2) Message-ID: <984128378.3aa89b7ab728f@sbox.tugraz.at> Date: Fri, 09 Mar 2001 09:59:38 +0100 (MET) Cc: mkamm@gmx.net MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: IMP/PHP IMAP webmail program 2.2.4 X-Originating-IP: 129.27.43.17 X-WebMail-Company: Hotmail Killers, Inc. Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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