On Dec 14, 2007 3:06 PM, Mark Bucciarelli <[EMAIL PROTECTED]> wrote:
> On 2007-05-10 8:40:36 Claudio Jeker wrote:
>
> > With many shortliving connections you have a lot of sockets in TIME_WAIT.
> > Because you are testing from one host only you start to hit these entries
> > more and more often this often results in a retry from the client.
>
> I'm curious what you meant by:
>
> "Because you are testing from one host
> only you start to hit these entries more ..."
>
> Entries in what?
>
> Why does it matter that the http requests come from the same host?
TCP requires that the four-tuple of <remote-IP, remote-port, local-IP,
local-port> be unique for each connection. If your test makes
connections from just one client to just port 80 on one IP of the
server, then three of the four parts of the tuple will all have the
same values. The only thing that can be different for those
connections will be the port on the client side. Since the valid port
number is range is 1 to 65535 and at least one end of the connection
will have to go through the TIME_WAIT state, that imposes a
theoretical limit of 65535 connections per TIME_WAIT duration. The
practical rate will be less than that because TCP implementations
generally refuse to use low-numbered ports unless explicitly bound
there. I believe OpenBSD limits such port assignments via the
net.inet.ip.porthi{first,last} sysctl variables which give you a
default range of only 16384 ports. Putting that together with the
normal TIME_WAIT period of 2 minutes means that a single OpenBSD
machine connecting to a single port on a server is limited to 136
connections per second on average.
Philip Guenther