Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Jan 2003 17:36:30 -0800
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Sam Tannous <stannous@employees.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: max simultaneous TCP connections (32,763)?
Message-ID:  <3E348D1E.DDAF6DF0@mindspring.com>
References:  <20030126195657.GA14704@cisco.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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?

You must tune up maxfiles at boot time, not afterwards, or
the number of tcpcb's and inpcb's will be limited to the
value of maxfiles at compile time, no matter what you set
it to later with that !#$%@&*! sysctl that pretends to be
read/write, but should really be read-only after boot time.

The limit on outbound connections is 65535.  Technically,
this is per IP, but you will have to read the kernel code
in some detail to use more than one IP, since FreeBSD has a
bug in inpcballoc, in that it treats all outbound sockets as
if they are allocated from the INADDR_ANY range, even if you
are only using a single IP address (technically, you should
be able to bind on the way out before a connect, but there
are some hoops ou have to jup through to avoid certain "if"
tests that should not be there.

Given the 32763 number, it looks like you are just quoting me
back to me, pretending the historical answer is the current
answer, and that has not been accurate since FreeBSD 4.5.

I have *personally* tuned a FreeBSD box with 4G of RAM, and
*personally* achieved a reacord number of connections.

The current record is 1,603,127 simultaneous connections, in
FreeBSD 4.4, without IPSEC.

As far as I know, I hold the single machine connection record
for an x86 box.

-- Terry

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?3E348D1E.DDAF6DF0>