summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2014-11-20 08:29:31 +0000
committerCorinna Vinschen <corinna@vinschen.de>2014-11-20 08:29:31 +0000
commitf70b9c32d5d5b09479b4087bb64f4b95c9821704 (patch)
tree4c335c083dcc6f7fc52f6ced4fae0f948d2c66b1
parent5c6a0f3117811cf11b98b471503e02fdc37f96f2 (diff)
downloadcygnal-f70b9c32d5d5b09479b4087bb64f4b95c9821704.tar.gz
cygnal-f70b9c32d5d5b09479b4087bb64f4b95c9821704.tar.bz2
cygnal-f70b9c32d5d5b09479b4087bb64f4b95c9821704.zip
* net.cc (fdsock): Change default values for socket buffers on 32 bit
to fix performance on 10Gb networks.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/net.cc11
2 files changed, 14 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index c8419f46c..46cd4c3fa 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2014-11-20 Iuliu Rus <rus.iuliu@gmail.com>
+
+ * net.cc (fdsock): Change default values for socket buffers on 32 bit
+ to fix performance on 10Gb networks.
+
2014-11-17 Corinna Vinschen <corinna@vinschen.de>
* uinfo.cc (pwdgrp::fetch_account_from_windows): Allow fetching of
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index 8ff88ba11..5c4959bdf 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -621,13 +621,20 @@ fdsock (cygheap_fdmanip& fd, const device *dev, SOCKET soc)
this is no problem on 64 bit. So we set the default buffer size to
the default values in current 3.x Linux versions.
+ NOTE 3. Setting the window size to 65535 results in extremely bad
+ performance for apps that send data in multiples of Kb, as they
+ eventually end up sending 1 byte on the network and naggle + delay
+ ack kicks in. For example, iperf on a 10Gb network gives only 10
+ Mbits/sec with a 65535 send buffer. We want this to be a multiple
+ of 1k, but since 64k breaks WSADuplicateSocket we use 63Kb.
+
(*) Maximum normal TCP window size. Coincidence? */
#ifdef __x86_64__
((fhandler_socket *) fd)->rmem () = 212992;
((fhandler_socket *) fd)->wmem () = 212992;
#else
- ((fhandler_socket *) fd)->rmem () = 65535;
- ((fhandler_socket *) fd)->wmem () = 65535;
+ ((fhandler_socket *) fd)->rmem () = 64512;
+ ((fhandler_socket *) fd)->wmem () = 64512;
#endif
if (::setsockopt (soc, SOL_SOCKET, SO_RCVBUF,
(char *) &((fhandler_socket *) fd)->rmem (), sizeof (int)))