---+ Windows-Specific Host Tuning ---++ Next Generation TCP/IP Stack in Windows Vista / Windows Server 2008 / Windows 7 According to http://www.microsoft.com/technet/community/columns/cableguy/cg0905.mspx, the new version of Windows, Vista, features a redesigned TCP/IP stack. Besides unifying IPv4/IPv6 dual-stack support, this new stack also claims much-improved performance for high-speed and asymmetric networks, as well as several auto-tuning features. The Microsoft Windows Vista Operating System enables the TCP [[WindowScalingOption][Window Scaling option]] by default (previous Windows OSes had this option disabled). This causes problems with various middleboxes, see WindowScalingProblems. As a consequence, the scaling factor is limited to 2 for HTTP traffic in Vista. Another new feature of Vista is [[CompoundTCP][Compound TCP]], a high-performance TCP variant that uses delay information to adapt its transmission rate (in addition to loss information). On Windows Server 2008 it is enabled by default, but it is disabled in Vista. You can enable it in Vista by running the following command as an Administrator on the command line. <verbatim> netsh interface tcp set global congestionprovider=ctcp </verbatim> (see CompoundTCP for more information). Although the new TCP/IP-Stack has integrated auto-tuning for receive buffers, the TCP *send* buffer still seems to be limited to 16KB by default. This means you will not be able to get good upload rates for connections with higher RTTs. However, using the registry hack (see further below) you can manually change the default value to something higher. ---++ Performance tuning for earlier Windows versions ---+++ Enabling TCP Window Scaling The references below detail the various "whys" and "hows" to tune Windows network performance. Of particular note however is the setting of scalable TCP receive windows (see LargeTcpWindows). It appears that, by default, not only does Windows not support TCP 1323 scalable windows, but the required key is not even in the Windows registry. The key (<nop>Tcp1323Opts) can be added to one of two places, depending on the particular system: =[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\MSTCP]= (Windows'95) <br> =[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters]= (Windows 2000/XP) Value Name: =Tcp1323Opts= <br> Data Type: =REG_DWORD= (DWORD Value) <br> Value Data: 0, 1, 2 or 3 <br> * 0 = disable RFC 1323 options * 1 = window scale enabled only * 2 = time stamps enabled only * 3 = both options enabled This can also be adjusted using DrTCP GUI tool (see link below) ---+++ TCP Buffer Sizes See the EndSystemTcpBufferSizing topic for general information about sizing TCP buffers. ---++++ Buffers for TCP Send Windows Inquiry at Microsoft (thanks to Larry Dunn) has revealed that the default send window is 8KB and that there is no official support for configuring a system-wide default. However, the current Winsock implementation uses the following undocumented registry key for this purpose =[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\AFD\Parameters]= Value Name: =DefaultSendWindow= <br> Data Type: =REG_DWORD= (DWORD Value) <BR> Value Data: The window size in bytes. The maximum value is unknown. According to Microsoft, this parameter may not be supported in future Winsock releases. However, this parameter is confirmed to be working with Windows XP, Windows 2000, Windows Vista and even the Windows 7 Beta 1. This value needs to be manually adjusted (e.g., DrTCP can't do it), or the application needs to set it (e.g., [[IperfTool][iperf]] with '-l' option). It may be difficult to detect this as a bottleneck because the host will advertise large windows but will only have about 8.5KB of data in flight. ---++++ Buffers for TCP Receive Windows (From [[http://technet.microsoft.com/en-us/library/bb463205.aspx#EEAA][this !TechNet article]] Assuming Window Scaling is enabled, then the following parameter can be set to between 1 and 1073741823 bytes =[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters\TcpWindowSize]= Value Name: =TcpWindowSize= <br> Data Type: =REG_DWORD= (DWORD Value) <BR> Value Data: The window size in bytes. 1 to 65535 (or 1 to 1073741823 if Window scaling set). DrTCP can also be used to adjust this parameter. ---++ Windows XP SP2/SP3 simultaneous connection limit Windows XP SP2 and SP3 limits the number of simultaneous TCP connection attempts (so called half-open state) to 10 (by default). How exactly it's doing this is not clear, but this may come up with some kind of applications. Especially file sharing applications like bittorrent might suffer from this behaviour. You can see yourself if your performance is affected by looking into your event logs: =EventID 4226: TCP/IP has reached the security limit imposed on the number of concurrent TCP connect attempts= A [[http://www.lvllord.de/?lang=en&url=tools][patcher]] has been developed to adjust this limit. ---++ References * [[http://www.microsoft.com/technet/interopmigration/unix/sfu/perfnfs.mspx#EEAA/][Performance Tuning Guidelines for Microsoft Services for Network File System]] has useful performance tuning tips for Windows 2003 Server, in particular for file service. This includes tuning network performance, so there are valuable hints on specific TCP/IP parameters. * [[http://support.microsoft.com/default.aspx?scid=kb;en-us;314053][TCP/IP and NBT configuration parameters for Windows XP (KB314053)]] describes many TCP/IP-related registry keys for Windows XP Professional and Home Edition. Not specifically related to network performance, but a useful reference. * [[http://www.microsoft.com/technet/prodtechnol/windowsserver2003/technologies/networking/tcpip03.mspx][Microsoft Windows Server 2003 TCP/IP Implementation Details]] describes the implementation of the TCP/IP protocol stack in the Microsoft® Windows Server 2003� family. Covers much of the same ground as the Windows XP reference (above), except where noted the Windows 2003 TCP/IP implementation is the same as the Windows XP. * [[http://support.microsoft.com/default.aspx?kbid=900937][TechNet Support WebCast: TCP/IP Stack Improvements in Windows Server 2003 and Windows Server 2003 Service Pack 1]] describes the improvements in TCP/IP functionality in Microsoft Windows Server 2003 and Microsoft Windows 2003 Service Pack 1 (SP1). This Webcast discusses these improvements. This includes performance improvements targeted at Internet facing servers that have enabled Windows Server 2003 to now support over a million connections over IA64. * [[http://www.microsoft.com/technet/scriptcenter/scripts/network/monitor/default.mspx][Monitoring Scripts]] - various VBScript scripts to monitor different aspects of system and (protocol-specific) network performance. Most of the TCP/IP-related scripts work on Windows 2003 and XP, but not on Windows 2000 or older versions. * [[http://rdweb.cns.vt.edu/public/notes/win2k-tcpip.htm][Windows 2000 TCP Performance Tuning Tips]], by Carl Harris (Virginia Tech) * [[http://www3.ietf.org/proceedings/07mar/slides/tsvarea-3/sld1.htm][Implementation Report on Experiences with Various TCP RFCs]], discusses the window scaling limitation in Windows Vista * [[http://www.dslreports.com/drtcp][DrTCP]], a GUI tool to adjust some (but not all, especially send buffer!) parameters -- Main.TobyRodwell - 28 Feb 2005 (initial version)<br> -- Main.SimonLeinen - 06 Apr 2005 (removed dead pointers; added new ones; descriptions)<br> -- Main.AlexGall - 17 Jun 2005 (added send window information)<br> -- Main.HankNussbacher - 19 Jun 2005 (added new MS webcast for 2003 Server)<br> -- Main.SimonLeinen - 12 Sep 2005 (added information and pointer about new TCP/IP in Vista)<br> -- Main.HankNussbacher - 22 Oct 2006 (added Cisco IOS firewall upgrade)<br> -- Main.AlexGall - 31 Aug 2007 (replaced IOS issue with a link to WindowScalingProblems, added info for scaling limitation in Vista)<br> -- Main.SimonLeinen - 04 Nov 2007 (information on how to enable Compound TCP on Vista)<br> -- Main.PekkaSavola - 05 Jun 2008 major reorganization to improve the clarity wrt send buffer adjustment, add a link to DrTCP; add XP SP3 connection limiting discussion -- Main.ChrisWelti - 02 Feb 2009 added new information regarding the send window in windows vista / server 2008 / 7
ore topic actions
Topic revision: r21 - 2009-08-11
Copyright © 2004-2009 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.