[newlib-cygwin] Add release message for commit 609d2b2

2017-02-03 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=a9f4b71e8e63c363cd461aec3e0910dfd492e777

commit a9f4b71e8e63c363cd461aec3e0910dfd492e777
Author: Corinna Vinschen 
Date:   Fri Feb 3 21:54:25 2017 +0100

Add release message for commit 609d2b2

Signed-off-by: Corinna Vinschen 

Diff:
---
 winsup/cygwin/release/2.7.0 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/winsup/cygwin/release/2.7.0 b/winsup/cygwin/release/2.7.0
index 37ef3c7..9ed0a00 100644
--- a/winsup/cygwin/release/2.7.0
+++ b/winsup/cygwin/release/2.7.0
@@ -28,3 +28,6 @@ Bug Fixes
 
 - Fix handling of a literal '+' by cygcheck -p
   Addresses:  https://cygwin.com/ml/cygwin/2014-01/msg00287.html
+
+- Fix limited Internet speeds caused by inappropriate socket buffering.
+  Addresses: https://cygwin.com/ml/cygwin-patches/2017-q1/msg00010.html


[newlib-cygwin] Fix limited Internet speeds caused by inappropriate socket buffering

2017-02-03 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=609d2b22afc63d80029a4fe85e64b51c84ccae08

commit 609d2b22afc63d80029a4fe85e64b51c84ccae08
Author: Corinna Vinschen 
Date:   Fri Feb 3 21:46:01 2017 +0100

Fix limited Internet speeds caused by inappropriate socket buffering

Don't set SO_RCVBUF/SO_SNDBUF to fixed values, thus disabling autotuning.

Patch modeled after a patch suggestion from Daniel Havey 
in https://cygwin.com/ml/cygwin-patches/2017-q1/msg00010.html:

At Windows we love what you are doing with Cygwin.  However, we have
been getting reports from our hardware vendors that iperf is slow on
Windows.  Iperf is of course compiled against the cygwin1.dll and we
believe we have traced the problem down to the function fdsock in
net.cc.  SO_RCVBUF and SO_SNDBUF are being manually set.  The comments
indicate that the idea was to increase the buffer size, but, this code
must have been written long ago because Windows has used autotuning
for a very long time now.  Please do not manually set SO_RCVBUF or
SO_SNDBUF as this will limit your internet speed.

I am providing a patch, an STC and my cygcheck -svr output.  Hope we
can fix this.  Please let me know if I can help further.

Simple Test Case:
I have a script that pings 4 times and then iperfs for 10 seconds to
debit.k-net.fr

With patch
$ bash buffer_test.sh 178.250.209.22
usage: bash buffer_test.sh 

Pinging 178.250.209.22 with 32 bytes of data:
Reply from 178.250.209.22: bytes=32 time=167ms TTL=34
Reply from 178.250.209.22: bytes=32 time=173ms TTL=34
Reply from 178.250.209.22: bytes=32 time=173ms TTL=34
Reply from 178.250.209.22: bytes=32 time=169ms TTL=34

Ping statistics for 178.250.209.22:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 167ms, Maximum = 173ms, Average = 170ms

Client connecting to 178.250.209.22, TCP port 5001
TCP window size: 64.0 KByte (default)

[  3] local 10.137.196.108 port 58512 connected with 178.250.209.22 port 
5001
[ ID] Interval   Transfer Bandwidth
[  3]  0.0- 1.0 sec   768 KBytes  6.29 Mbits/sec
[  3]  1.0- 2.0 sec  9.25 MBytes  77.6 Mbits/sec
[  3]  2.0- 3.0 sec  18.0 MBytes   151 Mbits/sec
[  3]  3.0- 4.0 sec  18.0 MBytes   151 Mbits/sec
[  3]  4.0- 5.0 sec  18.0 MBytes   151 Mbits/sec
[  3]  5.0- 6.0 sec  18.0 MBytes   151 Mbits/sec
[  3]  6.0- 7.0 sec  18.0 MBytes   151 Mbits/sec
[  3]  7.0- 8.0 sec  18.0 MBytes   151 Mbits/sec
[  3]  8.0- 9.0 sec  18.0 MBytes   151 Mbits/sec
[  3]  9.0-10.0 sec  18.0 MBytes   151 Mbits/sec
[  3]  0.0-10.0 sec   154 MBytes   129 Mbits/sec

Without patch:
dahavey@DMH-DESKTOP ~
$ bash buffer_test.sh 178.250.209.22

Pinging 178.250.209.22 with 32 bytes of data:
Reply from 178.250.209.22: bytes=32 time=168ms TTL=34
Reply from 178.250.209.22: bytes=32 time=167ms TTL=34
Reply from 178.250.209.22: bytes=32 time=170ms TTL=34
Reply from 178.250.209.22: bytes=32 time=169ms TTL=34

Ping statistics for 178.250.209.22:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 167ms, Maximum = 170ms, Average = 168ms

Client connecting to 178.250.209.22, TCP port 5001
TCP window size:  208 KByte (default)

[  3] local 10.137.196.108 port 58443 connected with 178.250.209.22 port 
5001
[ ID] Interval   Transfer Bandwidth
[  3]  0.0- 1.0 sec   512 KBytes  4.19 Mbits/sec
[  3]  1.0- 2.0 sec  1.50 MBytes  12.6 Mbits/sec
[  3]  2.0- 3.0 sec  1.50 MBytes  12.6 Mbits/sec
[  3]  3.0- 4.0 sec  1.50 MBytes  12.6 Mbits/sec
[  3]  4.0- 5.0 sec  1.50 MBytes  12.6 Mbits/sec
[  3]  5.0- 6.0 sec  1.50 MBytes  12.6 Mbits/sec
[  3]  6.0- 7.0 sec  1.50 MBytes  12.6 Mbits/sec
[  3]  7.0- 8.0 sec  1.50 MBytes  12.6 Mbits/sec
[  3]  8.0- 9.0 sec  1.50 MBytes  12.6 Mbits/sec
[  3]  9.0-10.0 sec  1.50 MBytes  12.6 Mbits/sec
[  3]  0.0-10.1 sec  14.1 MBytes  11.7 Mbits/sec

The output shows that the RTT from my machine to the iperf server is
similar in both cases (about 170ms) however with the patch the
throughput averages 129 Mbps while without the patch the throughput
only averages 11.7 Mbps.  If we calculate the maximum throughput using
Bandwidth = Queue/RTT we get (212992 * 8)/0.170 = 10.0231 Mbps.  This
is just about what iperf is showing us without the patch since the
buffer size is set to 212992 I believe that the buffer size is
limiting the thro