From owner-freebsd-hackers Sun Jan 26 12:13:15 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 54F5937B401 for ; Sun, 26 Jan 2003 12:13:14 -0800 (PST) Received: from out3.mx.nwbl.wi.voyager.net (out3.mx.nwbl.wi.voyager.net [169.207.3.121]) by mx1.FreeBSD.org (Postfix) with ESMTP id CFA2043F1E for ; Sun, 26 Jan 2003 12:13:13 -0800 (PST) (envelope-from silby@silby.com) Received: from [10.1.1.6] (d34.as7.nwbl0.wi.voyager.net [169.207.128.162]) by out3.mx.nwbl.wi.voyager.net (Postfix) with ESMTP id 1F9CE771CF; Sun, 26 Jan 2003 14:13:07 -0600 (CST) Date: Sun, 26 Jan 2003 14:20:55 -0600 (CST) From: Mike Silbersack To: Sam Tannous Cc: freebsd-hackers@freebsd.org Subject: Re: max simultaneous TCP connections (32,763)? In-Reply-To: <20030126195657.GA14704@cisco.com> Message-ID: <20030126141644.A607-100000@patrocles.silby.com> References: <20030126195657.GA14704@cisco.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, 26 Jan 2003, Sam Tannous wrote: > I have two freebsd boxes (back to back) and I've > been playing with a simple server on one machine > and client on the other machine (this was simply > an exercise with playing with kqueue). Both the > server and the client are single processes and the > client seems to stop at 32,763 connections. > > I've modified the port range, tcp keepalive, > kern.ipc.somaxconn, maxfiles, maxsockets, nmbclusters. > I even tried net.inet.tcp.tcbhashsize (up to 1024). > > Is there some other parameter I'm missing? Or is this > a known limitation/bug? > > --Sam Look more closely at the net.inet.ip.portrange.* sysctl values, you should be able to make the range as large as 1024 to 65535. At present, FreeBSD uses an overly simple hash table which only allows each outgoing port to be used once. As a result, the number of outgoing connections is definitely limited. However, there should be no similar limitation on incoming connections, other than memory size. You might consider setting up more clients and seeing how far you can push the server. :) Also, disabling keepalives shouldn't matter, they don't take up any additional space except for during the period when they are actually sent. (Which would require 2 hours of idle time.) Mike "Silby" Silbersack To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message