On 04/23/10 02:07 AM, Nils Goroll wrote:
I am running website regression tests and sometimes see connection resets as a
consequence of premature port reuse. Most of the time, happens after the 200th
to 400th connection to the same destination.
I'm on snv_134, connections over iwk
r...@haggis:~# ndd /dev/tcp tcp_time_wait_interval
60000
Looking at the trace provided, it is the server side which will stay
in TIME-WAIT state (the side initiating the close sequence, i.e.
sending the first FIN). So the above interval does not matter.
When TCP chooses an anonymous port, it first picks a random port
and then checks if it is being used. If not, it will go ahead
and uses that. If it is in use, it will try the next port. So
what you observed can happen. If what you want is to do regression
testing, I guess you can do
echo "tcp_random_anon_port/W 0" | mdb -kw
to make TCP choose anonymous port in a sequential manner. This
should maximize the interval a port is re-used. After the testing,
set tcp_random_anon_port back to 1 to make it choose randomly
again.
--
K. Poon.
[email protected]
_______________________________________________
networking-discuss mailing list
[email protected]