Date: Sun, 26 Jan 2003 16:40:07 -0500 (EST) From: Robert Watson <rwatson@freebsd.org> To: Sam Tannous <stannous@employees.org> Cc: freebsd-hackers@freebsd.org Subject: Re: max simultaneous TCP connections (32,763)? Message-ID: <Pine.NEB.3.96L.1030126163650.24134L-100000@fledge.watson.org> In-Reply-To: <20030126195657.GA14704@cisco.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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? Some of this has to do with limits on the available ancillary ports for out-going connections. Try adding additional IP addresses to the client machine, and forcing your client software to use specific IP addresses. TCP uniquely identifies connections by the pair of port numbers and IP addresses, so assuming unconstrained use of the outgoing port space on a particular IP, that TCP/IP can in theory support up to (approx) 64k outgoing connections. In practice, we only allocate out of specific ranges. By adding additional IP addresses for outgoing connections, you increase the number of potential connections to a particular remote IP/port tuple. However, if you're not specifying a local IP address, the stack will pick "the most appropriate" local address for the route, which is probably the first IP address on the interface associated with the route to the other endpoint. Hard-coding local addreses in your application overrides that. I've never tried this (i.e., using multiple IPs to get around the TCP/IP limit), so if it doesn't work, let me know. In theory, it should. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1030126163650.24134L-100000>
