From owner-freebsd-doc Fri Nov 16 10:30:11 2001 Delivered-To: freebsd-doc@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 734E337B419 for ; Fri, 16 Nov 2001 10:30:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id fAGIU1A18625; Fri, 16 Nov 2001 10:30:01 -0800 (PST) (envelope-from gnats) Received: from mailhost1.dircon.co.uk (mailhost1.dircon.co.uk [194.112.32.65]) by hub.freebsd.org (Postfix) with ESMTP id 55A3A37B41A for ; Fri, 16 Nov 2001 10:22:59 -0800 (PST) Received: from mail.blackmans.org (dx000662.dircon.co.uk [195.157.223.19] (may be forged)) by mailhost1.dircon.co.uk (8.9.3/8.9.3) with ESMTP id SAA14124 for ; Fri, 16 Nov 2001 18:22:57 GMT Received: by mail.blackmans.org (Postfix, from userid 1001) id 6E3D7183A; Thu, 15 Nov 2001 19:26:57 +0000 (GMT) Message-Id: <20011115192657.6E3D7183A@mail.blackmans.org> Date: Thu, 15 Nov 2001 19:26:57 +0000 (GMT) From: Mark Blackman Reply-To: Mark Blackman To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: docs/32041: Add point about net.inet.tcp.portange.{first,last} sysctl tunable to tuning(7) manpage Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 32041 >Category: docs >Synopsis: Add point about net.inet.tcp.portange.{first,last} sysctl tunable to tuning(7) manpage >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Nov 16 10:30:01 PST 2001 >Closed-Date: >Last-Modified: >Originator: Mark Blackman >Release: FreeBSD 4.4-STABLE i386 >Organization: Gnomes of Zurich >Environment: System: FreeBSD maddog 4.4-STABLE FreeBSD 4.4-STABLE #124: Fri Nov 2 04:05:32 GMT 2001 root@maddog:/usr/obj/usr/src/sys/BASIC i386 >Description: tuning(7) doesn't mention the net.inet.tcp.portange.{first,last} sysctl tunables and probably ought to as at least one published benchmark failed because the benchmarkers were unaware of its existence. http://www.samag.com/documents/s=1147/sam0108q/ >How-To-Repeat: Read the man page and fail to realize that net.inet.tcp.portange.{first,last} might need adjustment. >Fix: --- tuning.7 Sat Nov 3 03:32:43 2001 +++ - Thu Nov 15 19:10:11 2001 @@ -332,6 +332,32 @@ connections. .Pp The +.Em net.inet.ip.portrange.first +and +.Em net.inet.ip.portrange.last +tunables default to 1024 and 5000, respectively. These, like many other +sysctl tunables, are designed to limit the use of kernel resources +(i.e. port number space) unless there is an explicit requirement for +more than this reasonable default. These are the port numbers +allocated to sockets which were created with a +.Xr socket 2 +call where +the port number parameter was zero. This default range of ports (3977 +in total) is likely to be insufficient for a machine running a number +of client programs of whatever description. The 'first' tunable can't +be set below 1024, but may be set higher. +The 'last' tunable will usually be the one that requires tweaking on +a machine with numerous clients (that don't make use of the IP_PORTRANGE +.Xr setsockopt 2 +option). Assuming you have enough file descriptors and your client +code uses +.Xr perror 3 , +you will see a message like "Can't assign requested address" +(EADDRNOTAVAIL) or "Resource temporarily unavailable" (EAGAIN) if this is set +too low for your application. See /usr/src/sys/netinet/in.h for more +discussion. +.Pp +The .Em kern.ipc.somaxconn sysctl limits the size of the listen queue for accepting new tcp connections. The default value of 128 is typically too low for robust handling of new >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message