none
SMB2 registry settings RRS feed

  • Question

  • We have had some major problems with our application running in an environment with Windows 2008 SP1 (or later) and Windows Vista SP1 (or later). The problems seemed to be some kind of caching in SMB2 – and it was seen in our application when we created database-files with the Pervasive PSQL engine and afterwards tried to see if it was created with a FindFirstFile (Kernel32.dll). The FindFirstFile returns false even though the file exists but if we wait for approximately 6 seconds – the result from FindFirstFile is true.

     

    Disabling SMB2 on the server or on the client machine fixed the issue. However we have also found one single document on the internet which mentions some registry setting which allow us to only disable some of the “features” in SMB2. Can anyone direct us to any kind of information/documentation on the following registry settings?

     

    FileInfoCacheLifetime

    FileNotFoundCacheLifetime

    DirectoryCacheLifetime

     

    They are all DWord values located under:  HKEY_LOCAL_MACHINE\SYSTEM

    \CurrentControlSet\Services\LanmanWorkstation\Parameters and seems to be enough to fix the problem in our case.

    Monday, May 25, 2009 9:28 AM

Answers

  • Good morning again! The list below enumerates the new registry settings for Vista/2008+, as well as older ones, dating back to Windows 2000, along with links to the appropriate MSDN topics and knowledge base articles.

    Please note that we will not publish any knowledge base content on the new settings until 2008R2 & Windows 7 are released; so my earlier comment was a bit premature. The information on the new settings is all that is available at this time.

    Thanks for your patience!

    Regards,
    Bill Wesse


    ==============================================================================
    Registry values

    All listed settings are in the following registry location:

    Key: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkStation\Parameters

    Value type:    REG_*
    Value name: <name of value>
    Default:        <value if note present>

    ==============================================================================
    Vista, 2008, ...

    Value type: REG_DWORD
    Value name: AllowGuestAuthWhenSigningRequired
    Default:    FALSE

    Group Policy settings are not applied on member computers that are running Windows Server 2008 or Windows Vista SP1 when certain SMB signing policies are enabled
    http://support.microsoft.com/kb/950876

    When a Server Message Block (SMB) version 1 client establishes a non-guest session or a non-anonymous session with a server, the client enables security signatures for the server. Later sessions then inherit the security signature sequence that is already established.

    To improve security, Windows Server 2008 and Windows Vista SP1 prevent server authenticated connections from being maliciously downgraded to a guest session or to an anonymous session. However, this improved security does not address the scenario that is described in the "Symptoms" section (Event ID: 1058).

    ==============================================================================
    Vista, 2008, ...

    Value type: REG_DWORD
    Value name: FileInfoCacheLifetime
    Default:    10 (seconds)

    Used for increasing network file system performance.
    The caches are consistent when changes are made by the client, but if changes are made from another client, they may not be reflected until the cache times out.

    ==============================================================================
    Vista, 2008, ...

    Value type: REG_DWORD
    Value name: FileNotFoundCacheLifetime
    Default:    5 (seconds)

    Used for increasing network file system performance. The caches are consistent when changes are made by the client, but if changes are made from another client, they may not be reflected until the cache times out.

    ==============================================================================
    Vista, 2008, ...

    Value type: REG_DWORD
    Value name: DirectoryCacheLifetime
    Default:    10 (seconds)

    Used for increasing network file system performance. The caches are consistent when changes are made by the client, but if changes are made from another client, they may not be reflected until the cache times out.

    ==============================================================================
    Vista, 2008, ...

    Value type: REG_DWORD
    Value name: DisableBandwidthThrottling
    Default:    FALSE

    Performance Tuning Guidelines for Windows Server 2008.
    http://go.microsoft.com/fwlink/?LinkId=121171

    The default is 0. This setting is available starting with Windows Server 2008 SP2. By default, the SMB redirector throttles throughput across high-latency network connections in some cases to avoid network-related timeouts. Setting this registry value to 1 disables this throttling, enabling higher file transfer throughput over high-latency network connections.

    ==============================================================================
    Windows 2003, ...

    Value type: REG_DWORD
    Value name: DisableByteRangeLockingOnReadOnlyFiles
    Default:    FALSE

    How To Improve Windows 2003 File Server Performance
    http://support.microsoft.com/kb/555041

    ==============================================================================
    Windows 2003, ...

    Value type: REG_DWORD
    Value name: ExtendedSessTimeout
    Default:    1000 (seconds)

    Value type: REG_MULTI_SZ
    Value name: ServersWithExtendedSessTimeout
    Default:    <null>

    May be useful in high latency networks.

    Controls the time-out period that the client uses when sending requests to a server listed in ServersWithExtendedSessTimeout. The default is value is 1000 (or 16.67 minutes). You can increase this value on all Windows 2003 and later systems.

    ==============================================================================
    Windows 2003, ...

    Value type: REG_DWORD
    Value name: NoDeleteOnClose
    Default:    FALSE

    You cannot modify or delete files on an OS/2 Warp 4-based server that uses the HPFS file system
    http://support.microsoft.com/kb/813586

    ==============================================================================
    Windows 2003, ...

    Value type: REG_DWORD
    Value name: ScavengerTimeLimit
    Default:    0 (seconds)

    How To Improve Windows 2003 File Server Performance
    http://support.microsoft.com/kb/555041

    You may experience delays of between 10 and 60 seconds when you use UNC paths to access files that are stored on a remote SMB server on a multihomed Windows Server 2003-based computer
    http://support.microsoft.com/kb/890553

    ==============================================================================
    Windows 2000, ...

    Value type: REG_DWORD
    Value name: EnableCachingOnWriteOnlyOpens
    Default:    FALSE

    Write only files are not cacheable; note that this setting is not recommended due to possible side effects.
    Use SetFilePointer(...) and SetEndOfFile(...) instead.

    ==============================================================================
    Windows 2000, ...

    Value type: REG_DWORD
    Value name: EnableDownLevelLogOff
    Default:    FALSE

    Net3101 Error on OS/2 Server Because of SessionSetup SMB
    http://support.microsoft.com/kb/323582

    ==============================================================================
    Windows 2000, ...

    Value type: REG_DWORD
    Value name: EnablePlainTextPassword
    Default:    FALSE

    Unencrypted Passwords May Cause SP3 to Fail to Connect to SMB Servers
    http://support.microsoft.com/kb/166730

    ==============================================================================
    Windows 2000, ...

    Value type: REG_DWORD
    Value name: EnableSecuritySignature
    Default:    TRUE

    Value type: REG_DWORD
    Value name: RequireSecuritySignature
    Default:    FALSE

    Overview of Server Message Block signing
    http://support.microsoft.com/kb/887429

    Group Policy settings are not applied on member computers that are running Windows Server 2008 or Windows Vista SP1 when certain SMB signing policies are enabled
    http://support.microsoft.com/kb/950876

    Server Message Block communication between a client-side SMB component and a server-side SMB component is not completed if the SMB signing settings are mismatched in Group Policy or in the registry
    http://support.microsoft.com/kb/916846

    ==============================================================================
    Windows 2000, ...

    Value type: REG_DWORD
    Value name: OffLineFileTimeoutIntervalInSeconds
    Default:    1000

    Remote Storage and Windows 2000
    http://technet.microsoft.com/en-us/library/cc938445.aspx


    Escalation Engineer
    • Proposed as answer by Bill Wesse MSFT Tuesday, June 2, 2009 12:55 PM
    • Marked as answer by Oswald73 Wednesday, June 17, 2009 2:04 PM
    Tuesday, June 2, 2009 12:55 PM
  • Good morning once again. I regret my slow response; I've been (unavoidingly) out of the office.

    I revisited the caching code, and have found nothing new that bears on the problem; so your comments on caching are certainly accurate.

    What I forgot was that the redirector (rdbss.sys), where all of this is implemented, is a file system driver - which explains why a newly created file can make it into the 'file not count' cache - if FindFirstFile (or any file GetFile*, GetFullPath*, GetLongPath* API function, etc.) is called against the file before it is created.

    One way to verify this is the case in the Pervasive PSQL scenario, would be to use the Windows Sysinternals 'Process Monitor' utility (with appropriate process filters) to journal the file system activity.

    Windows Sysinternals
    http://technet.microsoft.com/en-us/sysinternals/

    Please let me know if I have answered your questions satisfactorily; if so, I will consider our conversation complete.

    Regards,
    Bill Wesse


    Escalation Engineer
    • Proposed as answer by Bill Wesse MSFT Wednesday, June 17, 2009 10:25 AM
    • Marked as answer by Oswald73 Wednesday, June 17, 2009 2:03 PM
    Wednesday, June 17, 2009 10:25 AM
  • Thank you for the compliment! My pleasure to assist. I expect there may be something going on with the file system calls from IIS - a quick browse of the source shows me that normal API calls are being made. However, that doesn't get the call tree for the create. Like I mentioned, Process Monitor may yield some insight.

    Regards,
    Bill Wesse

    Escalation Engineer
    Wednesday, June 17, 2009 2:31 PM

All replies

  • Good morning Oswald.

    I have duplicated your search results on the three registry values. They are indeed not currently documented by Microsoft. I can confirm they are available in Windows Vista, Windows 2008, and beyond - and that they do indeed control aspects of the Windows Server (file, print, named-pipe sharing) service.

    However, this forum is for software developers who are using the Open Protocol Specification documentation to assist them in developing systems, services, and applications that are interoperable with Windows. The Open Protocol Specifications can be found at: http://msdn.microsoft.com/en-us/library/dd208104(PROT.10).aspx.

    Since your post does not appear to be related to the Open Protocol Specification documentation set, we will locate and refer you to the appropriate Microsoft forum or other support group. I expect we should be able to provide this information tomorrow, due to the Memorial Day holiday today.


    Regards,
    Bill Wesse


    Escalation Engineer
    Monday, May 25, 2009 3:02 PM
  • Hello again! I have additional information for you ('More Info' below). Also, I have confirmed that questions of this sort do fall into our normal technical support offerings. Here are several links that should be of help to you for technical support questions:

    Help & Support Home' at http://support.microsoft.com/ (there are 'Self Support Options' available on this page).
    'Select a Product for Assistance' at http://support.microsoft.com/gp/assistsupport
    The Microsoft Knowledge Base at http://support.microsoft.com/search/


    More info:

    This is a normal behavior related to the new SMB2 directory cache feature, which provides a mechanism for SMB2 clients to significantly reduce the number of network roundtrips to the server while performing several common operations against a share.

    The client will populate the directory cache for the first enumeration so the subsequent enumeration can be done directly from the cache.

    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkStation\Parameters

    FileInfoCacheLifetime
    Default value: 10 (seconds)

    FileNotFoundCacheLifetime
    Default value: 5 (seconds)

    DirectoryCacheLifetime
    Default value: 10 (seconds)

    References:
    [MS-SMB2]: Server Message Block (SMB) Version 2 Protocol Specification
    http://msdn.microsoft.com/en-us/library/cc246482(PROT.13).aspx
    3.2.4.17 Application Requests Enumerating a Directory
    http://msdn.microsoft.com/en-us/library/cc246600(PROT.13).aspx

    Regards,
    Bill Wesse


    Escalation Engineer
    Tuesday, May 26, 2009 5:33 PM
  • Hi Bill,

     

    Thank you for your research.

     

    Before my post in this forum I was in fact in contact with Microsoft Technical Support – and ended up with a Core System Analyst who just said that my application didn’t support SP1. I haven’t been able to get more information from that channel. As you also know from your own search there is no information available in the knowledge base – so I would really appreciate if you could help me with a bit more information/documentation.

     

    As I mentioned we had the problem with the Pervasive SQL engine creating a new file and when we afterwards tried to see if it was created with FindFirstFile – this function returned false. However we tried to reproduce this kind of communication with a Web Service that created a txt-file with a call to CreateFile and afterwards we called FindFirstFile from the client computer. In this case FindFirstFile actually returned true – so I wonder what will trigger the SMB2 cache? If we know that – maybe we could avoid any registry settings…

     

    However if we need to disable some SMB2 features in our customers environment it would also be good to know if there are other registry settings that we could benefit of?

    Wednesday, May 27, 2009 8:11 AM
  • Glad to help. I have sent an internal inquiry concerning our procedures on getting things like this into the knowledge base. I suspect this is simply an oversight.

    By the way - the 3 REG_DWORDS are the only ones I can find in the system sources that control the SMB2 directory cache.

    I will get back with you on this as soon as I can. Thanks for your patience.

    Regards,
    Bill Wesse

    Escalation Engineer
    Wednesday, May 27, 2009 11:44 AM
  • Hello again Oswald - I have good news for you. I will begin working on a new knowledge base article to cover SMB2 registry control. It will take a few days to get the basic text put together, which will be followed by internal review before I can forward the rough cut to you.

    So, I anticipate being able to deliver around the middle of next week (give or take a bit). Thanks for your patience!

    Regards,
    Bill Wesse

    Escalation Engineer
    Wednesday, May 27, 2009 3:34 PM
  • Good morning again! The list below enumerates the new registry settings for Vista/2008+, as well as older ones, dating back to Windows 2000, along with links to the appropriate MSDN topics and knowledge base articles.

    Please note that we will not publish any knowledge base content on the new settings until 2008R2 & Windows 7 are released; so my earlier comment was a bit premature. The information on the new settings is all that is available at this time.

    Thanks for your patience!

    Regards,
    Bill Wesse


    ==============================================================================
    Registry values

    All listed settings are in the following registry location:

    Key: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkStation\Parameters

    Value type:    REG_*
    Value name: <name of value>
    Default:        <value if note present>

    ==============================================================================
    Vista, 2008, ...

    Value type: REG_DWORD
    Value name: AllowGuestAuthWhenSigningRequired
    Default:    FALSE

    Group Policy settings are not applied on member computers that are running Windows Server 2008 or Windows Vista SP1 when certain SMB signing policies are enabled
    http://support.microsoft.com/kb/950876

    When a Server Message Block (SMB) version 1 client establishes a non-guest session or a non-anonymous session with a server, the client enables security signatures for the server. Later sessions then inherit the security signature sequence that is already established.

    To improve security, Windows Server 2008 and Windows Vista SP1 prevent server authenticated connections from being maliciously downgraded to a guest session or to an anonymous session. However, this improved security does not address the scenario that is described in the "Symptoms" section (Event ID: 1058).

    ==============================================================================
    Vista, 2008, ...

    Value type: REG_DWORD
    Value name: FileInfoCacheLifetime
    Default:    10 (seconds)

    Used for increasing network file system performance.
    The caches are consistent when changes are made by the client, but if changes are made from another client, they may not be reflected until the cache times out.

    ==============================================================================
    Vista, 2008, ...

    Value type: REG_DWORD
    Value name: FileNotFoundCacheLifetime
    Default:    5 (seconds)

    Used for increasing network file system performance. The caches are consistent when changes are made by the client, but if changes are made from another client, they may not be reflected until the cache times out.

    ==============================================================================
    Vista, 2008, ...

    Value type: REG_DWORD
    Value name: DirectoryCacheLifetime
    Default:    10 (seconds)

    Used for increasing network file system performance. The caches are consistent when changes are made by the client, but if changes are made from another client, they may not be reflected until the cache times out.

    ==============================================================================
    Vista, 2008, ...

    Value type: REG_DWORD
    Value name: DisableBandwidthThrottling
    Default:    FALSE

    Performance Tuning Guidelines for Windows Server 2008.
    http://go.microsoft.com/fwlink/?LinkId=121171

    The default is 0. This setting is available starting with Windows Server 2008 SP2. By default, the SMB redirector throttles throughput across high-latency network connections in some cases to avoid network-related timeouts. Setting this registry value to 1 disables this throttling, enabling higher file transfer throughput over high-latency network connections.

    ==============================================================================
    Windows 2003, ...

    Value type: REG_DWORD
    Value name: DisableByteRangeLockingOnReadOnlyFiles
    Default:    FALSE

    How To Improve Windows 2003 File Server Performance
    http://support.microsoft.com/kb/555041

    ==============================================================================
    Windows 2003, ...

    Value type: REG_DWORD
    Value name: ExtendedSessTimeout
    Default:    1000 (seconds)

    Value type: REG_MULTI_SZ
    Value name: ServersWithExtendedSessTimeout
    Default:    <null>

    May be useful in high latency networks.

    Controls the time-out period that the client uses when sending requests to a server listed in ServersWithExtendedSessTimeout. The default is value is 1000 (or 16.67 minutes). You can increase this value on all Windows 2003 and later systems.

    ==============================================================================
    Windows 2003, ...

    Value type: REG_DWORD
    Value name: NoDeleteOnClose
    Default:    FALSE

    You cannot modify or delete files on an OS/2 Warp 4-based server that uses the HPFS file system
    http://support.microsoft.com/kb/813586

    ==============================================================================
    Windows 2003, ...

    Value type: REG_DWORD
    Value name: ScavengerTimeLimit
    Default:    0 (seconds)

    How To Improve Windows 2003 File Server Performance
    http://support.microsoft.com/kb/555041

    You may experience delays of between 10 and 60 seconds when you use UNC paths to access files that are stored on a remote SMB server on a multihomed Windows Server 2003-based computer
    http://support.microsoft.com/kb/890553

    ==============================================================================
    Windows 2000, ...

    Value type: REG_DWORD
    Value name: EnableCachingOnWriteOnlyOpens
    Default:    FALSE

    Write only files are not cacheable; note that this setting is not recommended due to possible side effects.
    Use SetFilePointer(...) and SetEndOfFile(...) instead.

    ==============================================================================
    Windows 2000, ...

    Value type: REG_DWORD
    Value name: EnableDownLevelLogOff
    Default:    FALSE

    Net3101 Error on OS/2 Server Because of SessionSetup SMB
    http://support.microsoft.com/kb/323582

    ==============================================================================
    Windows 2000, ...

    Value type: REG_DWORD
    Value name: EnablePlainTextPassword
    Default:    FALSE

    Unencrypted Passwords May Cause SP3 to Fail to Connect to SMB Servers
    http://support.microsoft.com/kb/166730

    ==============================================================================
    Windows 2000, ...

    Value type: REG_DWORD
    Value name: EnableSecuritySignature
    Default:    TRUE

    Value type: REG_DWORD
    Value name: RequireSecuritySignature
    Default:    FALSE

    Overview of Server Message Block signing
    http://support.microsoft.com/kb/887429

    Group Policy settings are not applied on member computers that are running Windows Server 2008 or Windows Vista SP1 when certain SMB signing policies are enabled
    http://support.microsoft.com/kb/950876

    Server Message Block communication between a client-side SMB component and a server-side SMB component is not completed if the SMB signing settings are mismatched in Group Policy or in the registry
    http://support.microsoft.com/kb/916846

    ==============================================================================
    Windows 2000, ...

    Value type: REG_DWORD
    Value name: OffLineFileTimeoutIntervalInSeconds
    Default:    1000

    Remote Storage and Windows 2000
    http://technet.microsoft.com/en-us/library/cc938445.aspx


    Escalation Engineer
    • Proposed as answer by Bill Wesse MSFT Tuesday, June 2, 2009 12:55 PM
    • Marked as answer by Oswald73 Wednesday, June 17, 2009 2:04 PM
    Tuesday, June 2, 2009 12:55 PM
  • Thank you very much Bill,

     

    I think the list can be useful.

     

    As I wrote in my last post we saw that when the communication went through an IIS Web Service (definitely with “changes made from another client”) we didn’t have any problems. Is it possible to explain why this communication is working and maybe also explain what should be done to achieve this with other applications?

    Tuesday, June 2, 2009 1:38 PM
  • Glad to help. Sorry I missed the IIS thing. I'll see what I can find out on that...
    Regards,
    Bill

    Escalation Engineer
    Tuesday, June 2, 2009 2:09 PM
  • Good morning Oswald. I see two scenarios concerning the no-cache behavior when the request is through a web server:

    If the web server is on the system hosting the target file, SMB2 doesn't come into play, thus eliminating directory caching. I expect this is not the case in your scenario.

    If the file is hosted on a server other than the web server (both being Windows 2008 SP1[+], I simply don't know why there was no directory caching.

    But there is a way to find out. Could you send me a network capture of the web server to file server interaction?

    Please email the network captures to the below (Wireshark or MS network Monitor 3.3, link below):

    to: dochelp@microsoft.com
    title: 'SMB2 Registry Settings'



    Microsoft Network Monitor 3.3
    http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=983b941d-06cb-4658-b7f6-3088333d062f

    Regards,
    Bill Wesse

    Escalation Engineer
    Thursday, June 4, 2009 2:57 PM
  • Thanks for the sample trace & code.

    I can't do much with the trace, since the significant traffic is on SSL. No problem, though. Your description (FindFirstFile succeeds from the client, right after calling the web service to create the file), matches with how SMB2 directory caching works - unless I missed something important. From the trace, I infer that:

    192.168.42.20  - client
    209.85.229.193 - server (web & file)

    ...if this is correct, then SMB2 doesn't have any reason to cache the file in the 'FileNotFound' cache), since it was created on the server itself, via the file system API, before the remote request (SMB2 via SSL).

    On another note, the code in the project was commented out so that:

    swtest calls the web service (myws), which calls CreateFile( C:\FocusIT\test\wstest.txt,,,CREATE_NEW,,.); swtest then invokes main, which calls CreateFile(y:\test\wstest.txt,,,CREATE_NEW,,) - presumably on a mapped drive.

    Regards,
    Bill Wesse


    Escalation Engineer
    Monday, June 8, 2009 5:11 PM
  • Hi Bill,

     

    I understand that you can’t do much with the trace – but I don’t understand why you say that the following “matches with how SMB2 directory caching works”:

     

    1.    A client program on a Windows Vista machine make a call to a procedure on a web service.

    2.    The web service is located on a Windows 2008 machine and the web service creates a file on this Windows 2008 server – using a local path: c:\FocusIT\test

    3.    The client program on the Windows Vista machine makes a call to FindFirstFile to see if the file is created. The client program uses a mapped drive like: y:\test.

    4.    FindFirstFile returns true - which of course is nice – but I really expected the opposite when SMB2 was enabled!

     

    The reason why we made this (silly) program was to try to emulate the “real problem” which happened when we used the client/server database Pervasive PSQL. If the Pervasive PSQL server (running on Windows 2008) created the file and we called FindFirstFile afterwards – then FindFirstFile would return FALSE. If we however removed the server engine and let the client engine create the file – FindFirstFile would return TRUE. I believe that it is the real nature of how SMB2 caching works.

     

    What I really don’t understand is why we don’t see the same behavior when we use a web service (on the server) instead of the database server (on the server).

    Tuesday, June 9, 2009 6:59 AM
  • Thanks - I most obviously did miss something, and will revisit the caching code.

    Why the web service and database server behave inconsistently is a mystery to me (at the moment). The first thing that comes to mind is that perhaps the PSQL scenario involves a preliminary call to FindFirstFile, before CreateFile(,,,CREATE_NEW,,), to avoid errors there. In that case, if the initial FindFirstFile fails, then the subseqent call after the create should return FALSE, meaning the FileNotFoundCacheLifetime setting is governing the response.

    But as I noted above, I will revisit caching, going further into the call tree & state data. I expect this will take me several days (calendar time, not clock time, of course).


    Regards,
    Bill Wesse


    Escalation Engineer
    Tuesday, June 9, 2009 3:55 PM
  • Good morning once again. I regret my slow response; I've been (unavoidingly) out of the office.

    I revisited the caching code, and have found nothing new that bears on the problem; so your comments on caching are certainly accurate.

    What I forgot was that the redirector (rdbss.sys), where all of this is implemented, is a file system driver - which explains why a newly created file can make it into the 'file not count' cache - if FindFirstFile (or any file GetFile*, GetFullPath*, GetLongPath* API function, etc.) is called against the file before it is created.

    One way to verify this is the case in the Pervasive PSQL scenario, would be to use the Windows Sysinternals 'Process Monitor' utility (with appropriate process filters) to journal the file system activity.

    Windows Sysinternals
    http://technet.microsoft.com/en-us/sysinternals/

    Please let me know if I have answered your questions satisfactorily; if so, I will consider our conversation complete.

    Regards,
    Bill Wesse


    Escalation Engineer
    • Proposed as answer by Bill Wesse MSFT Wednesday, June 17, 2009 10:25 AM
    • Marked as answer by Oswald73 Wednesday, June 17, 2009 2:03 PM
    Wednesday, June 17, 2009 10:25 AM
  • Hi Bill,

     

    Thank you very much for your research – I’m very happy that you have taken your time to investigate this “mystery” for us.

     

    In conjunction to the web service test I’ve just tried to make some FindFirstFile calls before I call the web service – however I still haven’t any problems with caching in this test-scenario.

     

    I think you have done a great job. Even though I still don’t get why the web service test behaves like it does – I think I’ve got an understanding of the SMB2 nature.

     

    I’ve have send a link to this thread to the Pervasive engineers so hopefully they will take a look at “their end” and see if they can avoid this pretty annoying caching behavior. I’ll mark your posts as the answers and stop the conversation here. Thanks.

    Wednesday, June 17, 2009 2:07 PM
  • Thank you for the compliment! My pleasure to assist. I expect there may be something going on with the file system calls from IIS - a quick browse of the source shows me that normal API calls are being made. However, that doesn't get the call tree for the create. Like I mentioned, Process Monitor may yield some insight.

    Regards,
    Bill Wesse

    Escalation Engineer
    Wednesday, June 17, 2009 2:31 PM
  • Bill Wesse:

    I happened across this old post and was wondering if anything has changed with respect to this information.  Today I was troubleshooting a problem with QuickBooks taking 10.54 seconds to launch, and I found that during this time, there was NO network activity, and the only thing that Process Monitor showed is a repeated CreateFile() call that fails with a FileNotFound.  After 10 retries (one second apart), the file was found and the launch continued.

    Anyway, after changing the registry value for DirectoryCacheLifetime to 1, QB now starts in 1.54s.  (In fact, I tested a value of 0, and QB starts almost instantly.)  I was also pleasantly surprised to see that this setting is dynamic -- I can change it on the fly and see the results immediately. If I set it to anything over 15, though, QB fails to retry any more and simply errors out.

    After doing some digging, it seems that the problem is similar to that discussed above.  A database call is made to the QB server engine which creates a new "MTA" file ON THE SERVER ITSELF.  The application on the client then attempts to open this MTA file and retries until it is successful.  Since the client-side SMB2 cache doesn't have the file in it, it fails for a full 10 seconds (or the cache timeout), then eventually succeeds.  This was causing me to waste a LOT of time every day, and I'm wondering how many other QuickBooks users may be out there that are suffering in silence.  We also support Pervasive PSQL databases here, and I have seen this issue on the Pervasive side, too.  I am thinking that the directory caching may have been a great idea, but perhaps there needs to be an option for the CreateFile() function call that allows the developer to bypass the cache and force the client make the network requests to look up the file anyway.  Does something like this exist already?

    Thursday, February 23, 2012 8:55 PM
  • Hi BtrieveBill,
    This forum is for software developers who are using the Open Specification documentation to assist them in developing systems, services, and applications that are interoperable with Microsoft products. The Open Specifications can be found at: http://msdn.microsoft.com/en-us/library/cc203350(PROT.10).aspx. Since your post does not appear to be related to the Open Specification documentation set we would appreciate it if you could try to post your question in a more relevant forum.

    General Windows Desktop Development Issues

    Thank you.


    Josh Curry (jcurry) | Escalation Engineer | Open Specifications Support Team

    Thursday, February 23, 2012 10:05 PM
    Moderator