This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Cygwin TCP slow
I don't know if this qualifies as a simple test case, but
if you don't already have wireshark, get it from
https://www.wireshark.org/download.html
get iperf-2.0.9.tar.gz from https://sourceforge.net/projects/iperf2/files/
change the setsockopt calls on lines 125 & 132 of src/tcp_window_size.c to
rc = 0;
./configure --prefix=/usr/local
make && make install
start wireshark & add a column for bytes in flight:
edit / preferences
appearance / columns
click on the "+" button to get a new row
double click on the "New Column", type BIF
double click the empty bit in the Fields column
type tcp.an which pulls up a pick list; click on tcp.analysis.bytes_in_flight
click on OK
find a public iperf server -- I got lucky & found one ~65ms away, so
thruput is going to be constrained by the 130ms round trip time.
start the wireshark capture
iperf -c <host name>
when it's done stop the capture & click on the BIF column header
What I get is a max bytes in flight of 66560
----recompile iperf using the windows cross-compiler
make clean
make distclean
./configure --prefix=/usr/local --build=i686-pc-cygwin --host=i686-w64-mingw32
make && make install
start capturing
iperf -c <host name>
when it's done stop the capture & sort on the BIF column
What I get is a max bytes in flight of 196608
So, for me, it's about a 3X difference between the native & cygwin app.
If the problem really is in net.cc as the OP said, have a look at
https://cygwin.com/git/gitweb.cgi?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/net.cc;h=e4805d3e11c3cea09b1cdfa27170dfe626265125;hb=HEAD
starting at line 587
/* Raise default buffer sizes (instead of WinSock default 8K).
I think starting with Windows Vista the default is tcp autotuning. So
unless there's some other reason for setting the send/receive buffer
it seems that cygwin apps would be better off going with the defaults.
Lee
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple