Header Script

How to Fix Slow Access to Network Shares

You may also like...

39 Responses

  1. Jimmy C says:

    I’m just hoping to clarify…
    I noticed that in the screenshot you add the registry key to: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Lanmanworkstation

    but in the instructions you say to add it:
    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Lanmanworkstation\Parameters

  2. Zubair Alexander says:

    Nice catch, Jimmy. The instructions are correct, the screenshot is incorrect. I fixed the error and have updated the screenshot accordingly. I appreciate you pointing out the error.

  3. Efren Marin says:

    I was a couple of weeks with this problem, disabled updates, reinstalled drivers, changed network settings. thanks for the contribution, I leave a line for CMD…

    Reg add hklm\System\CurrentControlSet\Services\Lanmanworkstation\Parameters /v DirectoryCacheLifetime /t REG_DWORD /d 0

  4. SCA says:

    Hi there, I have the same issue but we run on a farm/server based environment. I appreciate your help in advance.

  5. Khan says:

    Hi Guys,

    I think I am hitting the same wall here. Windows 10 Machine based in UK, the network share is based in NY data centre just few thousand miles away. When user opens an Excel or pdf file its taking ages to open the file on local machine. Please help.

  6. Ian says:

    Thanks! After an hour and a half of pulling out my hair found your post. Worked great just by the first step. Cheers from Canada!

  7. Zubair Alexander says:

    Hi Ian, glad to hear the first solution worked for you.

  8. Nyer says:

    Hi. I am confused a bit

    Where do you do make this registry change?

    A. Is it on the machine that does NOT have the share?
    B. Is it on the machine that has the share?

    Thanks.

  9. Emily Bowman says:

    Thanks for this! I haven’t tested for slow network connections, but I have a strong feeling that it’ll fix another problem I sometimes run into, where one client sometimes just can’t see a new or changed file in a shared folder even though everyone else does, no matter how much one refreshes.

  10. Zubair Alexander says:

    @Nyer sorry about the confusion. I am updating the article to make it clear where the change is required. If you are on Computer A and the access to shared network files on Computer B is very slow, then you will make the change in the registry on Computer A where you are experiencing the problem.

  11. Everton says:

    Thanks!! Perfect.

  12. Hank Tan says:

    The DWORD value for DirectoryCacheLifetime is already set to zero (0) and I am still having the same issue (slow access to files on the network share drives). Is there anything else that can help to resolve this? Your advise is greatly appreciated.

  13. Hank Tan says:

    Hi Zubair,

    I think I found a solution to my problem. In addition to setting the DWORD of DirectoryCacheLifetime to zero (0), the other two parameters below will have to also set to zero (0).

    FileInfoCacheLifetime Dword=0 ====> my problem is here…missing this parameter.
    FileNotFoundCacheLifetime Dword=0

    Hope this helps others who are having the same problem.

  14. Zubair Alexander says:

    Hi Hank, I guess you read the first four steps, but not step 5 in which I mentioned that if the first registry change doesn’t help then you may want to disable two additional SMB cache values that I have listed.

    Glad to hear that it fixed your problem. I appreciate you providing the feedback.

  15. Computer Guy says:

    Your undo advice is incorrect.

    Setting the values to 1 does not undo or re-enable the caches with their default values. It re-enables the caches with 1 second timeouts.

    The proper advice to undo the change is to delete the registry key(s) OR set these timeouts explicitly:
    DirectoryCacheLifetime = 10
    FileNotFoundCacheLifetime = 5
    FileInfoCacheLifetime = 10

    Source: https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-7/ff686200(v=ws.10)

  16. Zubair Alexander says:

    @Computer Guy: You are correct. To re-enable the caches you need to delete the registry keys, which will set them back to the default values, or manually set them to their default values. I have updated the article. Thanks for your feedback.

  17. Yu Lei says:

    I have been searching for a solution of the slow transfer speed problem on the internet, all I found were suggestions on buying new network hardware or set wifi from 2.4G to 5G.
    Thank you so much, your first tip solved the week-long problem that I experienced since the last win10 update. Cheers from China.

  18. Zubair Alexander says:

    @Yu Lei: Thank you for your feedback. Glad the tip worked for you.

  19. Nyer says:

    Hi. Does the change require a reboot?

  20. Zubair Alexander says:

    Microsoft doesn’t specifically say that the change requires a reboot in its article, but because registry changes often require a reboot, its best to restart the computer.

  21. Ian McLellan says:

    Here Is The Solution to Windows 10 Super slow file transfers, after Many Years, from 2013 to now (19 January 2020):
    1. Yes, do all those things that you have read about here and elsewhere. They will have some effect, but not much and it may be a temporary effect in speed increase. But they ARE worth doing.
    2. To actually achieve a permanent solution with speeds close to Window 7, the DELETE both Microsoft Windows Defender and also McAfee Antivirus, etc. programs. If you are using McAfee as your “Paid-For” antivirus, etc. software, then just delete the MS Defender. Read up on that…some reboots will be required before it is all gone.
    3. To delete McAfee, you download from McAfee main website and use their mass deletion program, named “MCPR.exe”.
    4. I use Norton 360, so it is the only Antivirus program in operation once I boot up. By deleting the other two, the computer only checks the files going in and out using one program, not three, and they fight it out which slows the file transfers even more. In fact, they stop if you more than two transfers at the same time. That is how anyone can Prove that even Windows 10 is not a genuine multi-threading operational system, unlike LINUX.
    5. This does work and is permanent. Be sure to delete the MCPR.exe sub-directory once you are finished.. You can search for the program name “MCPR.exe” on the C: Drive, it is usually hiding out in there. Good luck and Good Re-Booting twenty times…what can I say….”Microsoft so-called programming”. Regards, Ian.

  22. Sascha Wiechmann says:

    Hey,

    We ran into the opposite 🙂
    I admin about 70 machines – but with Win10 January 2019 Update (Jet 4.0. issues) we ran into issues with our Acess Database backend. Randomly the backend is destroyed twice a day from different machines.
    After we applied Directory Cache = 0, FileCache = 0 and FileNotFound = 0 the issue is gone – but….the system is so slow now you hardly can work.

    Does anybody have a clue for this? 🙂
    Best regards from here to you
    Sascha

  23. Zubair Alexander says:

    @Sascha: As I stated in my warning, you may experience a significant performance hit by disabling these caches. Did you try to just disable DirectoryCacheLifetime first and see what happens. According to Microsoft, turning off the FileInfoCacheLifetime is not recommended because it can nearly double the number of network transactions required.

    Perhaps you should consider experimenting with the values for these caches. Instead of turning them off completely, try to use a number between 0 and the maximum number suggested by Microsoft. For example, try using a number between 1-10 for FileInfoCacheLifetime and DirectoryCacheLifetime, and between 1-5 for the FileNotFoundCacheLifetime. I have never tried a variation of these values but it may be worth experimenting. If that doesn’t work, you may have to contact Microsoft tech support.

  24. Joseph Valenti says:

    I followed the updated instructions carefully. After rebooting… I could no longer access the shared drives on the file server that is on the local network. The newly created DWORD:
    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Lanmanworkstation\Parameters\DirectoryCacheLifetime was set to 0.

    I then deleted the DWORD entirely, rebooted again, and I still don’t see the network drives.

    Any assistance would be greatly appreciated.

  25. Joseph Valenti says:

    UPDATE… I RE-created the DWORD, but this time set the value to 10 (hex). Now, at least, I can see the shared folder on the file server. Speed is still terrible however…. two MB/s on a network that is all gigabit-ethernet.

  26. Zubair Alexander says:

    @Joeseph: If you haven’t already, you may want to make sure that you’ve read step #5 and the warning right after step #5. I mention in step #5 that if step #4 doesn’t work for you then you may need to disable FileInfoCacheLifetime and FileNotFoundCacheLifetime cache values.

  27. Terry Kauffman says:

    Alexander, thank you for the info, it’s helpful, somewhat. With the advent of the 64bit Windows 10 would a person change the DWORD to a QWORD if they were having slow response from network shares?
    I have a Win10 and a Mac High Sierra system that share files. From the Mac to Windows it reasonably fast – no complaint. But from Windows to Mac it takes approx. 10 – 12 seconds to display the directory structure. Would you consider this normal?

    I’m using a Netgear Nighthawk router connected to a giga-bit switch, DHCP. Everything is wired, no wireless.

  28. Zubair Alexander says:

    @Terry: Whether to use DWORD or QWORD has nothing to do with your Windows 10 version (32-bit vs. 64-bit). When you store data under a registry, you have to specify certain values and the type of data that is being stored. For example, the REG_DWORD value can store a type of data that’s a 32-bit number and REG_QWORD value can store a type of data that’s a 64-bit number. These numbers do not correspond to the Windows 10 operating systems.

    You would rarely see instructions to add QWORD entries. I have updated the article and added a note about DWORD/QWORD. Basically, if the instructions say to use DWORD then you use DWORD, if the instructions say to use QWORD then you use QWORD.

    In my opinion, 10-12 seconds is not normal to display the directory structure. You have to troubleshoot both the hardware and software to find the culprit.

  29. Terry Kauffman says:

    Alexander, this morning I re-read your post – my apologies for the Q-WORD/D-WORD question, you addressed in your post. So, after adding the additional entries (all three because the first one had no effect) to my Registry and setting the defaults you mentioned, the browsing to my two other computers (Mac High Sierra and Windows 10 Pro) is very quick – like it was when I first transitioned to Windows 10. The computers under Network in the File Manager populate immediately now as do the sub-folders.
    Thank you for your expertise.

  30. Terry Kauffman says:

    Zubair, After writing the post from earlier today I went back to work using my Mac for desktop publishing. It has been agonizingly slow – click on something, anything, and get the colored spinning wheel. It could be to launch an application, locate a file, select a font, it didn’t matter.
    As I went back to work I immediately noticed that there was no more delays/pauses. Everything was snappy quick. I wondered if the slowness on the PC was somehow increasing network traffic and therefore causing some service on the Mac to have to “answer” that service.
    You’re my new Windows 10 hero.
    Thanks, again.

  31. Filip says:

    You don’t need to edit the registry to adjust these. They can be set from an admin PowerShell window:
    set-SmbClientConfiguration -DirectoryCacheLifetime 0

    # view all settings
    get-SmbClientConfiguration

  32. Zubair Alexander says:

    @Filip: Thanks for your feedback.

  33. Shay says:

    This is just a GENIUS post. I have been going out of my mind trying to figure out WHY accessing files on my NAS has suddenly gotten so slow. I made the change to the registry and I’m back to flying top speed. Thank you ever so much for writing this (and my PC thanks you, because it was moments away from being tossed out the 16th floor window).

  34. Zubair Alexander says:

    @Shay: Thanks for your feedback. Glad to know that I was able to not only help you but I also saved a perfectly fine PC from getting tossed out of the 16th floor window :).

  35. Rita M. says:

    I just used this suggestion for a Windows 10 System with a ReadyNAS 316, and it works great now! Thank you!

  36. Bob says:

    OMG…This is AMAZING…I didn’t even have to reboot. I have struggled with the slow access to shares for a while. The difference is night and day. Thank you so much for this post and help!

  37. Dave says:

    Thanks! This has been driving me crazy and your first fix worked for me!

  38. Paul says:

    Thank you Zubair!! The single regedit entry (steps 1 – 4) fixed it for me. I noticed the problem after upgrading from Win10 1909 to 20H2 (I had problems with the upgrade itself, which disappeared once I uninstalled my antivirus, and reapplied 20H2. I don’t know if the problematic upgrade was a contributing factor to the issue here). In any event, I appreciate the help, and more importantly, that you took the effort to update/correct the article as needed! It boggles the mind that this is still a ‘default’ problem across multiple major versions of an OS. I suppose there’s a reason for not having the entry included. Would you happen to know why?

  39. Zubair Alexander says:

    @Paul: What I have documented is only a workaround for a problem that’s been around for a while. The DirectoryCacheLifetime entry is not included in the registry by default because Microsoft doesn’t want you to disable the cache. Cache is supposed to help you, but sometimes it does the exact opposite and slows things down.

Leave a Reply

Your email address will not be published. Required fields are marked *