From owner-freebsd-net Mon Oct 15 1:10: 5 2001 Delivered-To: freebsd-net@freebsd.org Received: from admin4.dircon.net (admin4.dircon.net [195.157.2.156]) by hub.freebsd.org (Postfix) with ESMTP id E438F37B40F for ; Mon, 15 Oct 2001 01:09:59 -0700 (PDT) Received: (from tdcmb2@localhost) by admin4.dircon.net (8.11.1/8.11.1) id f9F89cT12504; Mon, 15 Oct 2001 09:09:38 +0100 (BST) (envelope-from tdcmb2) Date: Mon, 15 Oct 2001 09:09:38 +0100 From: Mark Blackman To: John Polstra Cc: net@freebsd.org, le@cs.unc.edu Subject: Re: Connect(2) problem Message-ID: <20011015090938.A12490@admin4.dircon.net> References: <200110101546.f9AFkcd86407@vashon.polstra.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.2.5i In-Reply-To: <200110101546.f9AFkcd86407@vashon.polstra.com>; from jdp@polstra.com on Wed, Oct 10, 2001 at 08:46:38AM -0700 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org This actually sounds like a problem I hit once where the default settings actually restrict the number of ports. net.inet.ip.portrange.lowfirst: 1023 net.inet.ip.portrange.lowlast: 600 net.inet.ip.portrange.first: 1024 net.inet.ip.portrange.last: 5000 net.inet.ip.portrange.hifirst: 49152 net.inet.ip.portrange.hilast: 65535 specifically, portrange.first and portrange.last are set a bit low for some applications. By default you only get 5000-1024 ports (3976). set net.inet.ip.portrange.last=16384 or higher to get more ports. - Mark On Wed, Oct 10, 2001 at 08:46:38AM -0700, John Polstra wrote: > In article , > Nguyen-Tuong Long Le wrote: > > > > I have a software that simulates web clients and servers to create > > network congestion (for the purpose of doing research in network > > congestion). In our experiment, a client opens an HTTP connection > > to a server, fetches a number of objects, and then closes the > > connection. A problem I seem to have right now is that a client > > machine cannot simulate more than 3000 connections. When my client > > machine simulates more than 3000 connections, it's able to open > > a socket but then connect(2) fails with errno 35 (Resource > > temporarily unavailable). Another interesting notice is that the > > connect(2) system call blocks for a few miliseconds before it > > fails although fcntl(2) was used to make the socket non-blocking. > > The OS version I am using is FreeBSD 4.3-release. > > In addition to the suggestion from Alex Rousskov, adding these lines > to "/boot/loader.conf" may help: > > kern.ipc.maxsockets="8192" > kern.ipc.nmbclusters="32768" > > John > -- > John Polstra > John D. Polstra & Co., Inc. Seattle, Washington USA > "Disappointment is a good sign of basic intelligence." -- Chögyam Trungpa > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-net" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message