Friday, April 27, 2012

Windows 7 Slow Access to Network Shares

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.

Issue

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.

Workaround

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.

TCP Auto-Tuning

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 conservatively
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 conditions
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:

@echo off
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

goto warnthenexit

:ver_7
ocsetup MSRDC-Infrastructure /uninstall
netsh interface tcp set global autotuning=restricted
goto exit

:warnthenexit
echo Machine undetermined.

:exit


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"

30 comments:

  1. I'm having an issue at a client who runs on their workstations but the shortcuts point to the app on the server and the app reads alot of data from the server.

    Since putting in Windows 7 on a few clients on the clients with Windows 7 are having major performance issues in the client. Do you think this would solve the issue?

    ReplyDelete
    Replies

    1. microsoft windows 7 professional product key free , buy windows 7 key code , windows 10 pro product key sale , win 7 professional keygen , microsoft outlook 2010 product keys , windows 8.1 professional key , antivirus key store , upgrade windows 7 home basic genuine to ultimate , llOPhi

      Delete
  2. Thanks Clint. Changing just the TCP Auto-Tuning fixed my problem.

    ReplyDelete
  3. Ok, so I just need to comment because your spelling is kinda bad, and I found it hard to take what you said seriously.

    1) "Aporling"? Ouch. That's just brutal. Google a word if you're not sure how to spell it properly. It's not just a typo when you write "aporling" instead of "appalling".

    2) experiAncing = experiEncing

    3) "It feels simlar..." (similar)

    You've got a lot of certs so you'll still get decent work, but I advise you to spell check anything you publish on the internet. People want to be able to focus on your IT knowledge, not get distracted by abysmal spelling.

    ReplyDelete
    Replies
    1. Anonymous - The fact that he has taken the time to respond to an issue that has affected many is cause enough to overlook a typo or spelling error. FYI - "kinda" is not a work it is spelled "kind of" They make medication for people just like you.

      Clint, thank you for your post; I have not attempted your workaround yet but have encountered the same issue on a new system running W7 Pro on a Windows XP 2003 Server. Hopefully, this will help.

      Delete
    2. Yes, that is a typo....word* Boy am I in for some serious criticism.

      Delete
    3. did you ever hear the saying "tis a poor man that cant think of at least two ways to spell a word" in any event I really appreciate his technical input, I hope it will resolve my issues

      Delete
    4. @Anonymous: ...And, your serious criticism is well deserved. How many time do you Google a problem and spend endless hours reading nonsense? Or find the perfectly phrased question and no answer?

      This guy took time out of his busy life to help us. I very much appreciate his efforts, and the efforts of those like him. He did some very nice research and shared the results, and you slammed him?!?

      Delete
  4. This is my personal blog where I write about my experiences working in the IT industry. I have a busy schedule and do not have the time nore resources to get content reviewed before it is published. All content on my blog is "as is" and with no warranties or guarantees.

    ReplyDelete
  5. Mr Anonymous Spell checker, thanks for pointing out how ANAL you are! I would think if you wanted to be Clint's publisher the job is yours! (I know I am speaking out of line as I don't know Clint) but I for one (even if it does not resolve my problem today) appreciate what he has posted for down the road.

    Personally, I think your a real jerk for your posting and my opinion is if you don't like what you see, don't read it. Why are you here if you don't like his posts? Your as bad as a Mac Lover that hangs out in Microsoft forums to bash Microsoft. Seriously, I'd rather you not be here and you obviously don't care for what your reading, so leave. Again, i am speaking out of line as I too am a guest here.

    tHis lin wus mad 4 annnonnommmouuusss pooser how speal chks... - Mr. Me-off... As in Jack...

    ReplyDelete
  6. Running only the auto tuning command on the Win2k8 server instantly resolved our problem:

    netsh int tcp set global autotuninglevel=restricted

    It only took a million google attempts to find this page.

    THANKS!!!

    ReplyDelete
  7. Thanks for posting this.

    When I try to do netsh.. on the command prompt, I get this error message:

    "Set global command failed on IPv4. The requested operation requires elevation (Run as administrator)."

    However, my user account IS set to admin.

    Help?

    PS Whip me with a weasel in case I made any spellung mustayks.

    ReplyDelete
    Replies
    1. You need to run the command prompt as an administrator, and then run the command.

      Delete
  8. solution here: http://www.chicagotech.net/netforums/viewtopic.php?t=1619

    ReplyDelete
  9. Thank you, it makes a huge difference.
    I have several file servers on my home network and when launching "network" from the start menu it was taking tens of seconds until some of the servers were shown and even longer to access them. Changing the TCP auto-tuning solved the issue.

    ReplyDelete
  10. Hi Everybody! For me (Win7 x64, Windows Server 2012 Domain) the autotuning=restricted didn't solve it. Disabling RDC brought a major speed improvement. To me it still feels a little slow (which it shouldn't on gigabit ethernet), but at least now it's usable :-)

    Thanks Clint!

    ReplyDelete
  11. I had similar issues, huge time taken to bring up directory shares on a Win2k3 server using a win7 64bit client. Autotuning seemed to have no affect. I disabled RDC and share access is now nearly instant on the Win7 machine. Thanks!

    ReplyDelete
  12. Perfect and affordable repairs for all car radios and navigation systems of VW, Audi, Skoda, BMW, Ford, Becker, Mercedes and many others: http://www.autoradio-navi-doktor.de/

    ReplyDelete
  13. sir my pc in slow working with out any net slow working in open the windows7 is slowly open and net start after the internal server problem is face the again and again the note is show it and the not proper gives is net speed is proper use is the last 2years is continue but last 2 monht is truble in show it slow working in my pc what is the sort out the problem so looks your online set ups or not so my contect no.09825405967 in call me clear my questation is the proper not open the windows7 and net working

    ReplyDelete
  14. net is proper work but not open the web site sarch in not fast open the site is also truble

    ReplyDelete
  15. i am tweet in my a/c in tweet is write and post in not posting is proper and the internal server problem is the show it slide in my pc in 2days in show it

    ReplyDelete
  16. facebook page is open but not show it photos

    ReplyDelete
  17. mainly the every site in open truble in the not in net problem is not created in the site problem or net problem otherwise the system problem is what is the problem in the pc in problem what is problem is not detected the gives the message for your online gives reply me what's problem in my pc or site is chek it now online and sort out automatic is possible so solved you and your team is in working is detect the truble shoot i aspacted
    thanks

    ReplyDelete
  18. Thanks for sharing for knowledgeable blog

    best smb pc

    ReplyDelete
  19. That's is why we are IT and NOT FREAKING ENGLISH teachers. Good article.....

    ReplyDelete
  20. from 5 MB/s to 80 MB/s :) thanxXXL! (I was givin up..)

    ReplyDelete
  21. Thank you.Cool manual for access TCP network on Windows.It works cool.
    http://10webhostingservice.com/

    ReplyDelete
  22. Friends you can get genuine cheap pro keys for windows 7 from: www.cdekey.com, you can find many different versions for windows in this site.

    ReplyDelete