the TCP client reuses a source port and sends a SYN while the
server still has the old TIME_WAIT state, so the server does not
send a SYN/ACK.
after 6 seconds the client retransmits the SYN and the connect
succeeds.
so there are 2 problems:
1) the client reuses the port too soon.
2) the server could accept the SYN during
TIME_WAIT (it did in the old days, but because
tcp clients now use random ISS the server only
accepts 50% of SYNs in TIME_WAIT).
-m
On Mon, Jul 04, 2005 at 04:31:43PM -0400, Adam wrote:
> I used http_load to test out lighttpd's performance (both installed
> from ports), and noticed that sometimes connect takes 6 seconds:
>
> $ http_load -parallel 10 -seconds 10 urllist.txt
> 1974 fetches, 10 max parallel, 629706 bytes, in 10.0099 seconds
> 319 mean bytes/connection
> 197.205 fetches/sec, 62908.5 bytes/sec
> msecs/connect: 30.4779 mean, 5999.75 max, 0.036 min
> msecs/first-response: 1.81685 mean, 88.687 max, 0.127 min
>
> Just to make sure it wasn't a lighttpd or http_load problem, I tried
> the default apache included in openbsd, as well as using ab instead of
> http_load. I still get a few slow connects, always very close to 6
> seconds.
>
> The problem exists on both my laptop running the July 2 snapshot, and a
> server running a 3.6 snapshot from back in September. On both machines
> I tried running the tests from localhost and over the network, both
> with the same results. PF is disabled on both machines, and they are
> both running GENERIC kernels. Any ideas what could be causing this?
>
> Thanks
> Adam