One of my clients recently deployed Windows 7 across their network and are experiancing performance issues when accessing network resources involving MS-RPC calls such as network shares through the SMB protocol. Windows Vista/2008/7 has a new TCP network stack to Windows XP/2003 and has a number of new technologies designed to increase network performance.
Windows XP/2003 clients are not receiving performance problems.
When a Windows 7 PC attempts to accesss file shares on any Windows XP/2003 servers, browsing performance of mapped network shares is aporling. It feels simlar to accessing the file server over a VPN connection with poor bandwidth and high latency, however in this scenario we are accessing the file server over LAN. We tested a Windows 7 client on the same 24bit subnet as a number of Windows 2003 file servers on a 1gbps network. Slow access to network shares also occured over the same subnet.
What I did notice however was slow performance did not occur when a Windows Vista/2008/7 computer accesses file shares on another Windows Vista/2008/7. The issue only occured when Windows Vista/2008/7 accessed Windows XP/2003.
This issue is not driver related, I ensured to test workstations of different driver architecture including Intel and Broadcom network drivers.
After researching into this issue we came identified two Windows components contributing to the performance issues.
- TCP Auto-Tuning
- Remote Differential Compression
Do not disable these components unless you understand what they are and their purpose.
As mentioned above, a new TCP stack was implemented as of Windows Vista that aims to take full advantage of hardware advances such as gigabit networking. Among the new feature in the new TCP stack is Receive Window Auto-Tuning Level for TCP connections. TCP AutoTuning enables TCP window scaling by default and automatically tunes the TCP receive window size for each individual connection based on the bandwidth delay product (BDP) and the rate at which the application reads data from the connection, and no longer need to manually change TcpWindowSize registry key value which applies to all connection. Theoretically, with TCP auto-tuning, network connection throughput in Windows Vista should be improved for best performance and efficiency, without registry tweak or hack. However, this is not always the case, and may cause some performance related issues such as in our case.
The default auto-tuning level is "normal", and the possible settings for the
above command are:
disabled: uses a fixed value for the tcp receive window.
Limits it to 64KB (limited at 65535).
highlyrestricted: allows the
receive window to grow beyond its default value, very
restricted: somewhat restricted growth of the tcp
receive window beyond its default value
normal: default value, allows
the receive window to grow to accommodate most
experimental: allows the receive window to grow to
accommodate extreme scenarios (not recommended, it can degrade performance in
common scenarios, only intended for research purposes. It enables RWIN values of over 16 MB)
In my environment changing this from the default value of normal to restricted
resolved my performance issues.
netsh int tcp set global autotuninglevel=restricted
Remote Differential Compression
Remote Differential Compression (RDC) is a client–server synchronization algorithm that allows the contents of two files to be synchronized by communicating only the differences between them. It was introduced with Windows Server 2003 R2 and is included with later Windows client and server operating systems. As of Vista onwards Remote Differential Compression is enabled by default.
Microsoft does not recommend ever disabling Remote Differential Compression (RDC) unless there is an absolute need to. Diane from Microsoft wrote a blog post entitled "Debunking Myths about Remote Differential Compression and System Performance" where she states:
A number of third-party blogs are telling people they can speed up Windows Update downloads, and file copy operations, by turning off the Remote Differential Compression (RDC) feature on Windows Vista. This is 100% false. Neither Windows Update or file copy operations use RDC at all.
The RDC feature is simply a DLL that does not consume any system resources, except when you run an application that uses RDC specifically. If you disable RDC, any application that uses it will either not be able to take advantage of RDC or will simply fail. For more information on RDC see this link http://msdn.microsoft.com/en-us/library/aa373254(VS.85).aspx.
As a result I do not recommend disabling RDC unless you have an absolute need to. In my environemnt I tested my Windows 7 PC's with RDC turned on and RDC turned off. When turned on I noticed my performance to Windows 2003/XP file shares diminished. Please disable with care.
You can disable RDC through Windows Features in control panel:
You can also disable RDC through command line using the following command:
ocsetup MSRDC-Infrastructure /uninstall
Deploying the Workaround
I wrote a batch script to deploy this workaround to all Windows 7 computers on my network. The batch script first identifies IS
the computer running Windows 7, if so THEN
set TCP Autotuning to Restricted and disable Remote Differential Compression.
Here is a copy of my script:
systeminfo | find "OS Name" > %TEMP%\osname.txt
set /p vers=<%TEMP%\osname.txt
echo %vers% | find "Windows 7" > nul
if %ERRORLEVEL% == 0 goto ver_7
ocsetup MSRDC-Infrastructure /uninstall
netsh interface tcp set global autotuning=restricted
echo Machine undetermined.
Deploy this script to your workstations through a Group Policy Startup Script.
Note: Due to the Windows 7 performance issues I also needed to configure "Always wait for the network at computer startup and logon" under "Computer -- Administrative Templates -- System -- Logon"