You are running the Server Message Block (SMB)
protocol with Terminal Server enabled on a Microsoft Windows Server
2003-based server or on a Microsoft Windows 2000 Server-based
server. In this scenario, when you try to access files on a client
computer that is running Windows 2000 Server or Microsoft Windows NT
4.0, you may experience slow performance. It may take 30 to 60
seconds to complete a task. Typically, the delay will last exactly
35 seconds.
This problem occurs if several Remote Desktop
Protocol (RDP) client computers connect to the server at the same
time. The number of outstanding SMB requests that are sent from the
RDP client computers to the server may exceed the default maximum of
50 connections. When this behavior occurs, other SMB requests must
wait in the redirector on the client computer until the earlier
requests are answered or canceled, or until a time-out error
occurs.
The MaxMpxCt parameter
is set in the registry to specify the maximum number of simultaneous
client computer requests that can be made to a particular server.
When the client computer first establishes a connection with the
server, the MaxMpxCt parameter value
is passed from the server to the redirector on the client computer.
The limit on outstanding requests is enforced by the redirector on
the client computer.
Typically, each RDP client computer is
running the Explorer.exe process. When several RDP client computers
are connected to the server, Microsoft Internet Explorer makes
extensive use of directory notifications. This behavior causes
several NTNotifyDirectoryChange SMBs to be posted to the server.
These NTNotifyDirectoryChange SMBs enable the server to notify the
client computer when file or directory information
changes.
The NTNotifyDirectoryChange SMB is classified as a
long term request. The server receives the NTNotifyDirectoryChange
SMB. However, the server does not return the NTNotifyDirectoryChange
SMB until a change occurs or until the NTNotifyDirectoryChange SMB
is canceled by the client computer.
When several RDP client
computers connect to the server, the number of outstanding commands
against the server may exceed the default maximum of 50. When this
behavior occurs, other SMB requests must wait in the redirector
until the earlier requests are answered, or canceled, or until a
time-out error occurs.
Warning If you use Registry Editor
incorrectly, you may cause serious problems that may require you to
reinstall your operating system. Microsoft cannot guarantee that you
can solve problems that result from using Registry Editor
incorrectly. Use Registry Editor at your own risk.
To resolve
this problem, you must change the value of the
MaxCmds parameter and the
MaxMpxCt parameter in the registry of the
server and of the client computer. The maximum number of connections
that can be made is determined by the lesser of the
MaxCmds parameter or the
MaxMpxCt parameter. The explicit number is
sent from the server to the client computer during the negotiation
phase when you set up an SMB session.
To change the value of
the
MaxCmds parameter and the
MaxMpxCt parameter on the server and on the
client, follow these steps:
| 1. |
On the client computer, click Start, click Run, type regedit, and then click OK. |
| 2. |
Locate and then click the following subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters |
| 3. |
Right-click Parameters, point to New, and then click DWORD Value. |
| 4. |
Type MaxCmds, and
then press ENTER to name the new entry. |
| 5. |
Right-click MaxCmds, and then click Modify. |
| 6. |
In the Base area,
click Decimal. |
| 7. |
In the Value data
box, type 1024, and then click
OK. |
| 8. |
Quit Registry Editor. |
| 9. |
On the server, click Start, click Run, type regedit, and then click OK. |
| 10. |
Locate and then click the following subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanServer\parameters |
| 11. |
Right-click Parameters, point to New, and then click DWORD Value. |
| 12. |
Type MaxMpxCt, and
then press ENTER to name the new entry. |
| 13. |
Right-click MaxMpxCt, and then click Modify. |
| 14. |
In the Base area,
click Decimal. |
| 15. |
In the Value data
box, type 1024, and then click
OK. |
| 16. |
Quit Registry Editor. |
The most common symptom of this problem is when the
server sends an oplock break request regarding a locked file to the
client computer. If the client computer has received the maximum
number of outstanding requests, it cannot send the oplock break
response to the server. When this behavior occurs, input/output
(I/O) between the client computer and the server stalls until the
OplockBreakWait timer expires on the
server. The default value of the
OplockBreakWait timer is 35 seconds.
To
verify that the symptoms that you experience are caused by the
problem that is discussed in this article, you must view a Network
Monitor trace. For additional information about how to view a
Network Monitor trace, click the following article number to view
the article in the Microsoft Knowledge Base:
812953 How to use
Network Monitor to capture network traffic
The Network
Monitor trace will appear similar to the following:
395 0.005213 TSECLIENT FileServer SMB C transact2
Query path info, File = \dir1\subdir1\filename.xls IP
396
0.000083 FileServer TSECLIENT SMB R transact2 Query path info
(response to frame 395) IP
397 0.001951 TSECLIENT FileServer SMB
C transact2 Query file system info IP
398 0.000027 FileServer
TSECLIENT SMB R transact2 Query file system info (response to frame
397) IP
399 0.002763 TSECLIENT FileServer SMB C transact2 Query
path info, File = \dir1\subdir1\filename.xls IP
400 0.000073
FileServer TSECLIENT SMB R transact2 Query path info (response to
frame 399) IP
401 0.000869 TSECLIENT FileServer SMB C transact2
Query path info, File = \dir1\subdir1\filename.xls IP
402
0.000065 FileServer TSECLIENT SMB R transact2 Query path info
(response to frame 401) IP
The query from the client
computer will appear similar to the following:
403 0.000603 TSECLIENT FileServer SMB C NT create
& X, File = \dir1\subdir1\filename.xls IP
There will be
a lock on the file. The server will ask the client computer to break
the lock on the file. This request will appear similar to the
following:
404 0.018093 FileServer TSECLIENT SMB C lock &
X, FID = 0xae37, Unlocks = 0 (0x62 for 0x3c0000) IP
The
client computer will acknowledge the request from the server on the
TCP level, but not on the SMB level. If this behavior occurs, the
client computer will not respond to the server, and the Network
Monitor trace will appear similar to the following:
405 0.100696 TSECLIENT FileServer TCP Control
Bits: .A...., len: 0, seq: 765791988-765791988, ack:2687722727,
win:63772, src: 1314 dst: 139 (NBT Session) IP
If the
client computer does not respond to the server within a specified
time, the server will send an oplock break request to the client
computer. If the client computer does not respond to the oplock
break request from the server within a specified time, the
OplockBreakWait timer that is on the server
will expire. When this behavior occurs, the Network Monitor trace
will appear similar to the following:
406 34.901136 FileServer TSECLIENT SMB R NT create
& X, FID = 0xae3e IP
407 0.000309 TSECLIENT FileServer SMB C
transact2 Query path info, File = \dir2\subdir2 IP
For
additional information, click the following article numbers to view
the articles in the Microsoft Knowledge Base:
191370 Slow network
performance with Terminal Server
271148 MaxMpxCt and
MaxCmds limits in Windows 2000
296264 Configuring
opportunistic locking in Windows
The third-party products that
this article discusses are manufactured by companies that are
independent of Microsoft. Microsoft makes no warranty, implied or
otherwise, regarding the performance or reliability of these
products.