How do I disable opportunist locking?

A. Windows XP and Windows 2000 support opportunist locking, which lets Sever Message Block (SMB) clients lock a file on the server and cache the information, without having to worry whether another user might change the file (earlier Windows versions also support this feature, but the method is different). Opportunist locking leads to better performance for the user. However, it adds a workload to the server, which must maintain and manage the locks. You can use one of two methods to disable opportunist locking.

Method 1

  1. Start regedit.exe.
  2. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MRxSmb\Parameters.
  3. From the Edit menu, select New, DWORD value.
  4. Enter a name of OplocksDisabled, and press Enter.
  5. Double-click the new value, and set it to 1.
  6. Click OK.

Method 2

  1. Start regedit.exe.
  2. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters.
  3. From the Edit menu, select New, DWORD value.
  4. Enter a name of EnableOplocks and press Enter.
  5. Double-click the new value, and set it to 0.
  6. Click OK.

In addition, under the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters, you can set the following optional parameters to tune opportunist locking:

  • MinLinkThroughput (DWORD)—The minimum number of bytes per second that must be maintained through the server before the lock is disabled (0 to infinite)
  • MaxLinkDelay (DWORD)—The maximum time allowed for a delay in the link before the lock is disabled (0 to 100,000 seconds)
  • OplockBreakWait (DWORD)—The time the server waits for a client holding a lock to respond to a lock break request before forcefully breaking the lock (10 to 180 seconds)
Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish