From owner-freebsd-net@FreeBSD.ORG Mon Aug 20 15:11:48 2007 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6408416A421 for ; Mon, 20 Aug 2007 15:11:48 +0000 (UTC) (envelope-from is@rambler-co.ru) Received: from relay0.rambler.ru (relay0.rambler.ru [81.19.66.187]) by mx1.freebsd.org (Postfix) with ESMTP id 20C5713C481 for ; Mon, 20 Aug 2007 15:11:48 +0000 (UTC) (envelope-from is@rambler-co.ru) Received: from relay0.rambler.ru (localhost [127.0.0.1]) by relay0.rambler.ru (Postfix) with ESMTP id 08933619C for ; Mon, 20 Aug 2007 19:11:47 +0400 (MSD) Received: from localhost (is1.park.rambler.ru [81.19.64.121]) by relay0.rambler.ru (Postfix) with ESMTP id C2F456184 for ; Mon, 20 Aug 2007 19:11:46 +0400 (MSD) Date: Mon, 20 Aug 2007 19:11:42 +0400 From: Igor Sysoev To: freebsd-net@freebsd.org Message-ID: <20070820151142.GA20183@rambler-co.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: No virus found Subject: maximum number of outgoing connections X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2007 15:11:48 -0000 It seems that FreeBSD can not make more than net.inet.ip.portrange.last - net.inet.ip.portrange.first simultaneous outgoing connections, i.e., no more than about 64k. If I made ~64000 connections 127.0.0.1:XXXX > 127.0.0.1:80, then connect() to an external address returns EADDRNOTAVAIL. net.inet.ip.portrange.randomized is 0. sockets, etc. are enough: ITEM SIZE LIMIT USED FREE REQUESTS FAILURES socket: 356, 204809, 13915, 146443, 148189452, 0 inpcb: 180, 204820, 20375, 137277, 147631805, 0 tcpcb: 464, 204800, 13882, 142102, 147631805, 0 tcptw: 48, 41028, 6493, 11213, 29804665, 0 I saw it on 6.2-STABLE. -- Igor Sysoev http://sysoev.ru/en/