Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Your ASP or ASP.NET application may restart or you may lose the session object when more SMB requests exist than the Web server can process


View products that this article applies to.

Symptoms

You work with Microsoft ASP.NET or Microsoft Active Server Pages (ASP) that are stored on a remote file share that uses the Server Message Block (SMB) protocol. When more SMB requests exist than the Web server can process, your Web application may unexpectedly restart or you may lose the session object. When this problem occurs, you may receive the following error message in the error log:
Failed to start monitoring directory changes.
Note Remote file shares that use the SMB protocol can include Network Attached Storage (NAS) devices, System Area Networks (SAN), or UNIX-based shares.

↑ Back to the top


Cause

This problem occurs when the number of SMB requests to the server is larger than the resources that are allocated to handle the requests. If the SMB redirector receives too many network requests, you may lose the session object, your application may restart, and you may receive an error message in the error log.

Note This problem may occur because of server load or the remote file share load. To verify that the load on the server is the problem, click Start, click Run, type perfmon, and then click OK. Then, if the value of the Redirector/Current Commands entry is more than 90 percent of the maximum load value, raise the capacity of the server.

This problem may occur when the number of SMB requests outnumber the resources to handle those requests, or it may occur when the number of SMB requests on the file share outnumber the resources to handle those requests.

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

↑ Back to the top


Resolution

To work around this problem, increase the number of connections that you can have by resetting the registry values of the
MaxCmds
and the
MaxMpxCt
subkeys. The recommended values are 253, 1124, and 2048. To do this, follow these steps.

Note In this section, the LanmanWorkstation is the Web server and the LanmanServer is the remote share.

Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
322756 How to back up and restore the registry in Windows
  1. Verify that the setting for the
    MaxCmds
    registry value on the Web server is 50 or greater. To do this, follow these steps:

    Note The
    MaxCmds
    entry is a REG_DWORD decimal entry. If it does not exist, you can create it as a new REG_DWORD value. The range of values for this registry entry is between 0 and 65535. If the
    MaxCmds
    and subkey does not exist, create the subkey.
    1. Click Start, click Run, type regedit, and then click OK.
    2. Locate and then click the following subsubkey in the registry:
      HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\parameters
    3. In the right pane, double-click the MaxCmds value.
    4. In the Value box, verify that the number is 50 or greater. If the number is not greater than 50, increase the value to one of the recommended values.
    5. Exit Registry Editor.
    Note In a Microsoft Windows Terminal Services environment, you may have to set the
    MaxCmds
    registry value to 500 or greater. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
    232476 Terminal Server client connections and logon limited by MaxWorkItem and MaxMpxCt values
  2. Verify that the setting for the
    MaxMpxCt
    registry value on the Microsoft Windows 2000-based server is 50 or greater. If the
    MaxMpxCt
    subkey does not exist, create the subkey. To do this, follow these steps:
    1. Click Start, click Run, type regedit, and then click OK.
    2. Locate and then click the following subkey in the registry:
      HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\parameters
    3. In the right pane, double-click the MaxMpxCt value.
    4. In the Value box, verify that the number is 50 or greater. If the number is not larger than 50, increase the value to one of the recommended values.

      Note The
      MaxMpxCt
      value determines the maximum number of active requests that the server allows for at the same time from an individual client.
    5. Exit Registry Editor.
  3. Repeat steps 1 and 2 on the remote share.
Note If you increase these values on the x86 platform, the file server and the IIS clients will consume additional non-paged pool memory. Non-paged pool memory has an upper limit of 256 megabytes (MB). Lots of clients together with lots of connections can consume all the non-paged pool memory on the file server. Use Performance Monitor to watch this counter and to make sure that it is not approaching the limit. On the x64 platform, non-paged pool memory has an upper limit of 128 gigabytes (GB). Therefore, you can increase these values to the maximum value. For more information about the differences between non-paged pool memory on the x86 platform and on the x64 platform, click the following article number to view the article in the Microsoft Knowledge Base:
294418 Comparison of 32-bit and 64-bit memory architecture for 64-bit editions of Windows XP and Windows Server 2003

↑ Back to the top


More information

Note This article does not apply to x64-based computers.

For more information about SMB and about your specific hardware and software configuration, contact your vendor or service provider.

For more information about the SMB Redirector and how to raise the value of the MaxMpxCt and MaxMpx keys, click the following article numbers to view the articles in the Microsoft Knowledge Base:
317249 How to troubleshoot Event ID 2021 and Event ID 2022
810886 "The network BIOS command limit has been reached" error message in Windows Server 2003, in Windows XP, and in Windows 2000 Server

↑ Back to the top


Keywords: KB843584, kbprb, kbsmb

↑ Back to the top

Article Info
Article ID : 843584
Revision : 3
Created on : 8/11/2009
Published on : 8/11/2009
Exists online : False
Views : 625