SO_REUSEADDR correlated with low TCP throughput?

From: Andrew Green (ag@em.net)
Date: Tue May 09 2000 - 02:51:08 EST


This is my first post to the list, athough I do read Kernel Traffic every
week. My apologies if I violate any accepted norms.

I have found an interesting TCP/IP behavior in 2.0.32, 2.2.10 and 2.2.12,
the three kernel versions running on machines I have access to. Before going
further I should say that I'm afraid I'm not in a position to install 2.3.x
to check if this behavior is present in the most recent kernel, and I'd be
very grateful if someone could do so on my behalf (it should only take a
minute or two.)

The behavior I'm seeing is that if I create a listening socket, and apply
SO_REUSEADDR to it, any socket created by an accept on that socket will have
*very* low throughput.

On my main machine (running 2.2.14-5.0smp with two 350MHz PIIs on a Tyan
1832 mobo), connecting to localhost and writing in 8K chunks I'm seeing
about 150KB/sec. Without the application of SO_REUSEADDR I'm seeing 27MB/s.
Connecting from that machine to a P90 running 2.0.32 I'm seeing 75KB/s vs
800KB/s). Over a 192Kb/s link, with ping times approx 200ms, I'm seeing
1KB/s vs 19KB/s. In all I've tried this on two machines locally, and three
more at other sites, each of which uses a different ethernet card. The
behavior also manifests itself when the server is connected and written to
by clients running on MacOS and Windows.

My gut sense is that the effective throughput is more closely correlated to
link latency than to link bandwidth, but I could easily be wrong.

I've written a tiny app to demonstrate the problem, the source for which is
at
  <http://www.em.net/~ag/snippets/tcptest.cpp>
Build and usage instructions are in comments at the head of the file.

I hope I've provided enough information for anyone to replicate the problem
quickly and easily. If I've messed up, please do let me know.

Andrew Green

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon May 15 2000 - 21:00:12 EST