Sending data from Windows is slow over any network with high latency but linux is fast

tcp

Sending data from Windows machine to the Windows or Linux over network with high latency is using 10% of the link capacity. Meanwhile, sending same data over the same network from Linux is almost ten times faster. The issue is same even when high latency is only simulated on the low latency connection by delaying the packets.

It seems that it affects all applications I have tried. Tests were performed on Windows 7 and Windows Server 2003 and the same behaviour was observed.

From tcpdump it is evident that Windows sends about 10 packets in the quick burst and then waits for the ACK, meanwhile Linux sends about hundred packets without waiting for the ACK.

I have tried to enable Compound TCP without improvement.

I am looking for any suggestions on how to find out what is going on. And also how to fix it.

Best Answer

I was able to completely solve my issue by increasing the size of the TCP send and receive buffer in Windows registry (restart is required):

[HKEY_LOCAL_MACHINE \SYSTEM \CurrentControlSet \Services \Afd \Parameters]
DefaultReceiveWindow = 1024000
DefaultSendWindow = 1024000

If these keys are not present, the default is 8KB for both which was the amount of data after which Windows was waiting for the ACK.

Also make sure that

netsh interface tcp show global

does not show

Receive Window Auto-Tuning Level    : disabled

Otherwise TCP Window Scaling is disabled not only for receiving but also for sending which will significantly limit the connection speed. To enable TCP Window Scaling set Auto-Tuning level for example to normal:

netsh interface tcp set global autotuninglevel=normal
Related Topic