Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Feb 2004 22:48:13 -0600 (CST)
From:      Mike Silbersack <silby@silby.com>
To:        Bill <freebsd@gardrail.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Obtaining 75k (active) concurrent tcp sessions..
Message-ID:  <20040212223845.E570@odysseus.silby.com>
In-Reply-To: <20040213001513.M60613@gardrail.com>
References:  <20040213001513.M60613@gardrail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On Thu, 12 Feb 2004, Bill wrote:

> I read a post that was sent to freebsd-hackers, which mentioned an
> individual was able to obtain 1.6 million concurrent tcp sessions, so I
> assume it's possible.

That was with a heavily modified version of FreeBSD, you wouldn't be able
to hit 1.6 million out of the box.

> My goal is to setup a server, which is capable of accepting at least 75k tcp
> connections to perform some firewall stress tests at work.  Given that
> information on this subject is quite scarce, I thought I'd post this
> question and see what type of response I get back.
>
> Any assistance or suggestions would be greatly appreciated,
>
> Thanks in advance,
>
> -=-Bill-=-

I've run tests up to a few thousand connections, I believe that 75000
should be doable, but it will take tuning.  Start with 5000 and keep
increasing in increments of 5000 from there, upping values for various
resource limits as you hit them.  I think that maxsockets, mbuf clusters,
and maxfiles will be your main limitations... they should all scale to
75000, but I'm not sure how many people have done so.

Now, if you want good performance... that could be another story.
However, if all you're doing is having a sample app which accepts
connections and holds them open until the client hangs up, then you should
be able to do it.  (If you were sending real data, then the amount of
memory being used for socket buffers might become a problem.)

Note that for the client side of those connections, you may need more than
one machine; with only ~65535 possible ephemeral ports available per IP
(and it being tough to use the same ephemeral port on different IPs with
the BSD network stack), it'd be best to just do two client machines with
75000/2 connections each.  (There is no such limit for the server side, of
course.)

Post to this list if you run into any problems, or find any specific
issues that prevent you from reaching the goal.

Mike "Silby" Silbersack



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040212223845.E570>