Configure opportunistic locking
Serdar Yegulalp

Opportunistic locking is a way of granting read access to a file on a Windows 2000 machine by more than one other client at a time. With op-lock enabled, as long as no write operations are attempted, clients can perform read-ahead operations that are cached locally; this accelerates operations on the files. The downside of opportunistic locking is that it comes with a slight performance hit. This is because the server granting the op-lock must manage breaking the lock when another user requests access to the same file that is locked.

Locking is enabled by default, but it can be toggled off, and editing the Registry can modify its parameters. To enable or disable opportunistic locking, open REGEDT32 and navigate to the key HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MRXSmb\Parameters\ and look for the subkey OplocksDisabled (REG_DWORD). Set this to 0 to enable op-locking; set it to 1 to disable it.

To edit settings for op-locking, navigate to HKEY_LOCAL_MACHINESYSTEM\CurrentControlSet\Services\LanmanServer\Parameters and look for the following REG_DWORD values:

EnableOplocks: Set to 1 to enable op-locking for all clients; set to 0 to disable op-locking globally.

OplockBreakWait: A value in seconds, from 10-180, with a default of 35. Set this to change the time the server waits for clients

    Requires Free Membership to View

to respond to a request to break an op-lock. This setting can be useful for slow connections.

MinLinkThroughput: Normally zero, calibrated in bytes per second. Set this to change the minimum throughput before the server disables op-locking.

MaxLinkDelay: Normally 60 seconds, but can be set from 0-100,000. Set this to turn off op-locking if link delays over the network exceed this number. This is useful if you have a great many WAN links to the server that are, say, hosted through slow dialup connections.

Serdar Yegulalp is the editor of the Windows 2000 Power Users Newsletter.

This was first published in March 2002

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.