Menu

Wednesday, February 6, 2013

Oplocks option in NetApp qtree


Oplocks

    Oplocks (opportunistic locks) enable the redirector on a CIFS client in certain file-sharing scenarios to perform client-side caching of read-ahead, write-behind, and lock information. A client can then work with a file (read or write it) without regularly reminding the server that it needs access to that file, which improves performance by reducing network traffic.

    By default, oplocks are enabled for each qtree. If you disable oplocks for the entire storage system, oplocks are not sent even if you enable oplocks on a per-qtree basis.

When to use oplocks

    If a process has an exclusive oplock on a file and a second process attempts to open the file, the first process must relinquish the oplock and its access to the file. The redirector must then invalidate cached data and flush writes and locks, resulting in possible loss of data that was to be written.
CIFS oplocks on the storage system are on by default. You might turn CIFS oplocks off under either of the following circumstances (otherwise, you can leave CIFS oplocks on):
You are using a database application whose documentation recommends that oplocks be turned off.
You are handling critical data and cannot afford even the slightest data loss.

Enabling CIFS oplocks for a specific volume or qtree

    If you've previously disabled CIFS oplocks for a specific volume or qtree, and now you want to reenable them, you can do so by using the qtree oplocks command.

Step 1:
             Ensure that the cifs.oplocks.enable option is set to on. Otherwise, enabling CIFS oplocks for a specific volume or qtree has no effect.
qtree oplocks path enable

Step 2: ( example )

            To enable CIFS oplocks on the "bigdata" qtree in "vol10", use the following commands

netapp1> options cifs.oplocks.enable on
netapp1> qtree oplocks /vol/vol10/bigdata enable

Step 3:
             You can verify the update by using the qtree status command, using the name of the containing volume if you updated the CIFS oplocks for a qtree.

No comments:

Post a Comment