Troubleshooting Errors That Occur When UNC Content Is Under High Load

Applies To: Windows Server 2003, Windows Server 2003 with SP1

If the Web server and the remote file server are not configured properly for high stress conditions, errors might occur. The following configuration errors might be reported in the browser, in the event log on the IIS server or remote file server, or the IIS logs:

  • Windows cannot find the network path. Verify that the network path is correct and the destination computer is not busy or turned off. If Windows still cannot find the network path, contact your network administrator. Error code: 0x80070033

  • The network location cannot be reached. For information about network troubleshooting, see Windows Help.Error code: 0x800704CF

  • Not enough server storage is available to process this command. Error code: 0x8007046

Modifying the MaxUserPort Registry Entry

The first two errors are returned when the server running IIS has a shortage of outbound TCP ports when it attempts to make the UNC connection. In this case, the Web server returns HTTP 500 errors for all requests until TCP ports are available again. To fix this problem, you can modify the MaxUserPort registry entry on the server running IIS to specify an increase in the number of available ports. This entry does not exist in the registry by default. To add it to the registry, use the registry editor, Regedit.exe.

Warning

Do not edit the registry unless you have no alternative. The registry editor bypasses standard safeguards, allowing settings that can damage your system, or even require you to reinstall Windows. If you must edit the registry, back it up first and see the Registry Reference in the Microsoft Windows Server 2003 Deployment Kit.

For example, if you have many concurrent authenticated users, a different SMB connection is opened from the computer running IIS to the remote file server for each individual user. These SMB connections use ports. By default, you are limited to ports from 1024 to 5000 for outbound TCP connections (slightly fewer than 4,000 ports are available), so you might need to increase this value to a higher number, such as 10000 or 20000, to provide additional ports for SMB connections. Be aware that this might cause problems with applications that create sockets on these higher ports. For more information, see Microsoft Windows 2000 TCP/IP Implementation Details.

Checking the File Server Setting

If you receive the Not enough server storage is available to process this command. Error code: 0x8007046A message, check your file server settings. This IIS error usually accompanies event log messages like the following:

  • The server was unable to allocate from the system nonpaged pool because the pool was empty.

  • The server was unable to allocate a work item <n> times in the last 60 seconds.

Normally, these messages indicate that your file server is set to use too much nonpaged system memory. This can be quickly verified by opening Task Manager, clicking the Performance tab and checking the Nonpaged value in the Kernel Memory frame. Limit the amount of kernel memory that the Server service can use by configuring the SMB settings as discussed later in this section.

When troubleshooting this kind of error, check the following performance counters on the computer running the Web server:

  • Server\Files Open

  • Server\Server Sessions

  • Server\Work Item Shortages

Modifying the Work Item Configuration

When two computers communicate, one SMB connection is used for each user. However, within an SMB connection, there are a finite number of work items. Work items can be consumed in a variety of ways and for varying amounts of time. For example, performing an operation against a file (by using CreateFile, GetFileAttributes, or other similar Windows APIs) takes up an I/O work item for a short period of time, but asking for a change notification on a directory structure takes up a work item for as long as the connection is maintained.

The network location cannot be reached. For information about network troubleshooting, see Windows Help.Error code: 0x800704CF and Not enough server storage is available to process this command. Error code: 0x8007046 errors usually can be fixed by changing the following registry entries, which are related to SMB configuration: MaxCmds, MaxMpxCt, and MaxWorkItems.

On the remote file server, you can update these registry entries in the following location: HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters.

On the server running IIS, you can update these registry entries in the following location: HKLM\System\CurrentControlSet\Services\LanmanWorkstation\Parameters.

The MaxCmds, MaxMpxCt, and MaxWorkItems registry entries do not exist in the registry by default. To add them to the registry, use the registry editor, Regedit.exe.

Note

For these registry values to take effect, you must stop and start the Server service on the remote file server and the Workstation service on the server running IIS. You do not need to restart the computers.

Before changing the MaxCmds, MaxMpxCt, and MaxWorkItems registry entries to troubleshoot work item shortages and system memory consumption, you need to understand how work items are consumed. Work item consumption occurs as follows:

  • Only one SMB connection is created per Web server/file server connection per user.

  • Each change notification instance uses a work item until the connection is ended.

  • Each request from the Web server to the file server uses a work item temporarily.

  • Typically, each work item takes up about 20K of non-paged pool memory. Although certain Microsoft Knowledge Base articles specify setting the value of the MaxWorkItems registry entry to 16000, doing so consumes approximately 320 MB of non-paged pool memory, which could overwhelm system resources. To increase the reliability of your system, always set this number lower than this recommended value.

  • To calculate the value of the MaxCmds registry entry, use the following formula:

    (the number of distinct physical directories that IIS needs to monitor for change notifications) * (1 (if static files exist) + 1 (if ASP content exists) + 1 (if ASP.Net content exists) ) + 50 (for concurrent default/regular file IO)

Note

This formula approximates a recommended value. Depending on the amount of concurrent traffic, you might need to increase your values.

Table 11.13   Values for SMB Settings lists the default and maximum values for the relevant SMB settings on Windows Server 2003. These SMB settings also apply to the Microsoft Windows® 2000 Server operating system.

Table 11.13 Values for SMB Settings

Registry Entry Default Value Maximum Value

MaxCmds

50

65535

MaxMpxCt

50

65535

MaxWorkItems

Scaled on memory size, usually between 1KB and 4KB.

65535