Knowledge Base Reference: 100041 Dated: 09/04/2002
File Locking on Windows 2000
Configuring Opportunistic Locking in Windows 2000 (Q296264)
Extracted for Microsoft Knowledge Base
--------------------------------------------------------------------------------
The information in this article applies to:
Microsoft Windows NT, 2000 & XP
--------------------------------------------------------------------------------
SUMMARY
Windows 2000 server message block (SMB) clients can disable opportunistic locking, so that those clients can lock files and locally cache information without the risk of another user changing the file. This increases performance for many file operations, but may decrease performance in other operations, because the server that grants the opportunistic lock must manage the breaking of that lock when another user requests access to the file.
MORE INFORMATION
The location of the client registry entry for opportunistic locking has changed in Windows 2000 from the earlier location in Microsoft Windows NT. In Windows 2000, the registry entry that disables opportunistic locking is:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MRXSmb\Parameters\
OplocksDisabled REG_DWORD 0 or 1
Default: 0 (not disabled)
You can also set Windows 2000 to deny the granting of opportunistic locks by setting the following registry entry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters
EnableOplocks REG_DWORD 0 or 1
Default: 1 (true)
In addition, you can use the following values to tune opportunistic locking for Windows 2000-based computers that have granted opportunistic locks.
The following value specifies the minimum link throughput that the server allowed before it disables raw and opportunistic locks for this connection:
MinLinkThroughput REG_DWORD 0 to infinite bytes per second
Default: 0
The following value specifies the maximum time that is allowed for a link delay. If delays exceed this number, the server disables raw I/O and opportunistic locking for this connection:
MaxLinkDelay REG_DWORD 0 to 100,000 seconds
Default: 60
The following value specifies the time that the server waits for a client to respond to an oplock break request (smaller values allow detection of crashed clients more quickly, but might potentially cause loss of cached data):
OplockBreakWait REG_DWORD 10 to 180 seconds
Default: 35
Links to Network & File Locking Problems
Registry Settings are to be done at own risk
Disabling Read Caching on Windows Workstations
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\VxD\VREDIR
DiscardCacheOnOpen REG_BINARY 0 or 1
Default: 0 (not disabled) Set to 01 00 00 00.
Disabling Read Caching on Windows Servers (Q124916)
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services \LanmanServer\Parameters
CachedOpenLimit REG_DWORD
Default: 5 Set to 0.
Disabling Opportunistic Locking on Windows Servers
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters
EnableOpLockForceClose REG_DWORD 0 or 1
Default: 0 (not disabled) Set to 1.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters
EnableOplocks REG_DWORD 0 or 1
Default: 1 (true) Set to 0. (Q129202) (Q296264)
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MRXSmb\Parameters
OplocksDisabled REG_DWORD 0 or 1
Default: 0 (not disabled) Set to 1. (Q296264)
Disabling Opportunistic Locking on Windows Workstations
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters
EnableOpLockForceClose REG_DWORD 0 or 1
Default: 0 (not disabled) Set to 1.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManWorkstation\Parameters
EnableOplocks REG_DWORD 0 or 1
Default: 1 (true) Set to 0.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters
UseOpportunisticLocking REG_DWORD 0 or 1
Default: 1 (true) Set to 0. (Q129202)
Click here to links & download
A Server can be a computer running a NT file system such as Win2000, XP or NT w/s.
------------------------------------------------------
This information is supplied by dka as a guide and takes no responsibility in
incorrect configurations. Qualified IT personnel should do any settings.