Re: strange loopback tcp performance problem

Andi Kleen (ak@muc.de)
23 Oct 1998 11:22:55 +0200


tridge@samba.anu.edu.au (Andrew Tridgell) writes:

> While running some speed tests on Samba I came across a severe
> performance problem with the current 2.1 TCP stack on loopback.
>
> The problem is that the tcp throughput varies between about 200 k/sec
> and 25 MB/sec on my unlodaded K6-200 running 2.1.125. A 2.0.34 kernel
> delivers a consistent 16 MB/sec on a similar machine.
>
> I've written a small test program which is available at
> ftp://samba.anu.edu.au/pub/tridge/misc/socklib.tgz
[...]
This is a known problem. Linux 2.1 TCP is sending so fast that it empties
the window before the receiving process has a chance to be scheduled to empty
the queue. There is also some inaccuracy in the window calculation which
leads usually one dropped packet, which causes retransmits, which explains the
performance anomaly you are seeing.

> ./sock_sink -t "TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=16384 IPTOS_THROUGHPUT"
>
> The critical thing appears to be that the sender is doing 1k writes
> (the -b 1024 option above). I expected this to make a small
> difference, but not a factor of 100. And why the huge varience between
> runs?

Scheduling. Another reason is that until recently (fixed in the vger tree now)
packets with the PSH bit set weren't processed in the fast receive path.
Linux sets more PSH bits for small writes (but this should only make a small
difference)

-Andi

-
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/