MS Windows
Note: We use Linux for our high-performance hosts, and don't have any MS Windows expertise in house. Please help us keep this page up to date by sending us updates. Thanks!
Versions of Microsoft Windows, starting with Vista and progressing through 10, include the ability to use a variety of TCP Autotuning and have some controls over buffer management.
Windows 8/10
The 'PowerShell' is the mechanism that can be used to modify some of the settings of the TCP stack. More information can be found here:
https://docs.microsoft.com/en-us/powershell/module/nettcpip/set-nettcpsetting?view=win10-ps
This command changes the custom TCP setting to have a value of 64 for the initial congestion window and use "Compound TCP" (an advanced TCP congestion control algorithm which is similar to cubic on Linux). The "InitialCongestionWindowMss" specifies the initial size of the congestion window, and it can be an even number from 2 through 64.
Set-NetTCPSetting -SettingName "Custom" -CongestionProvider CTCP -InitialCongestionWindowMss 64
Other useful settings include:
-AutoTuningLevelLocal
Specifies a TCP auto-tuning level for the host computer. TCP auto-tuning can improve throughput on high throughput, high latency networks
- Disabled. Sets the TCP receive window to the default value.
- HighlyRestricted. Sets the TCP receive window to grow beyond the default value, but very conservatively.
- Restricted. Sets the TCP receive window to grow beyond the default value, but less conservatively than HighlyRestricted.
- Normal. Sets the TCP receive window to grow to accommodate almost all scenarios.
- Experimental (recommended). Sets the TCP receive window to grow to accommodate extreme scenarios.
-Timestamps
Specifies whether to enable timestamps. Timestamps facilitate round trip measurement, and can help protect against wrapped sequence numbers on high throughput links. For more information about TCP timestamps, see RFC 1323. The acceptable values for this parameter are:
- Enabled (recommended)
- Disabled
-EcnCapability
Specifies whether to enable ECN capability. The acceptable values for this parameter are:
- Enabled. Uses ECN capability.
- Disabled (recommended). Does not use ECN capability.
Windows Vista/7
Vista and 7 will use up to a 16 MB maximum receive window, 8 and 10 can theoretically support up to 1G.
These varieties support an advanced TCP congestion control algorithm called "Compound TCP (CTCP)", which is similar to cubic on Linux. To enable this in Vista and 7, set the following:
netsh interface tcp set global congestionprovider=ctcp
If you even need to disable / re-enable autotuning, here are the commands:
netsh interface tcp set global autotuninglevel=disabled
netsh interface tcp set global autotuninglevel=normal
Note: You have to have administrator rights for these commands to work.
To launch a command prompt with administrator rights:
Click start
Type CMD.EXE in the search box
Press SHIFT+ CTRL+ENTER
select yes in the UAC dialog box.
There is no way to adjust the default TCP buffer in Vista/7, which is 64 KB. Also, the Windows Vista/7 autotuning algorithm is not used unless the RTT is greater than 1 ms, so single stream TCP will be throttled on a LAN by this small default TCP buffer.
Note: We have received reports that on Windows 2008 R2 server, TCP window scale is broken when the RTT is between 1 and 8ms. Hopefully there will be a patch soon.
For more information:
Recommended: | Windows 7, Vista, 2008 Tweaks |
TCP Receive Window Auto-Tuning in Vista | |
Enterprise Networking with Windows Vista |
Windows XP
Note that the tuning settings described here may decrease performance of hosts connected at rates of OC3 (155 Mbps) or less, such as home users on Cable/DSL connections.
The easiest way to tune TCP under Windows XP is to get DrTCP from "DSL Reports". Set the "Tcp Receive Window" to your computed BDP (e.g. 4000000), turn on "Window Scaling" "Selective Acks", and "Time Stamping".
Other programs that allow you to edit Windows TCP settings include SG TCP Optimizer.
To verify the changes, you can use the Windows Registry editor to verify the following:
# turn on window scale and timestamp option
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Tcp1323Opts=3
# set default TCP receive window size
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\TcpWindowSize=256000
# set max TCP send/receive window sizes (max you can set using setsockopt call)
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\GlobalMaxTcpWindowSize=16777216
For more information:
Recommended: | Windows network tuning. |
Useful: | TCP Configuration Parameters |
Windows 2000/XP Registry Tweaks |