HP CIFS Opportunistic Locking Usage Guidelines
9
Chapter 4 Opportunistic Locking
Recommendations
Opportunistic locking is a desirable feature when it can enhance the perceived performance
of a networked client. However, the opportunistic locking protocol is not robust, and
therefore can encounter problems when invoked beyond a simplistic configuration, or on
extended, slow, or faulty networks. In these cases, operating system management of
opportunistic locking and/or recov ering from repetitive errors can offset the perceived
performance advantage that it is intended to provide.
“Opportunistic Locking” is actually an improper name for this feature. The true benefit of
this feature is client-side data caching, and oplocks is merely a notification mechanism for
writing data back to the networked storage disk. The limitation of opportunistic locking is
the reliability of the mechanism to process an oplock break (notification) between the server
and the caching client. If this exchange is faulty (usually due to timing out for any number
or reasons) then the client-side caching benefit is negated.
The actual decision that a user or administrator should consider is whether it is sensible to
share amongst multiple users data that will be cached locally on a client. In many cases the
answer is no. Deciding when to cache or not cache data is the real question, and thus
“opportunistic locking” should be treated as a toggle for client-side caching. Turn it “ON”
when client-side caching is desirable and reliable. Turn it “OFF” when client-side caching is
redundant, unreliable, or counter-productive.
Opportunistic locking is by default set to “on” by CIFS/9000 Server on all configured shares,
so careful attention should be given to each case to determine if the potential benefit is worth
the potential for delays. The following recommendations will help to characterize the
environment where opportunistic locking may be effectively configured.
4.1 Exclusively Accessed Shares
Opportunistic locking is most effective when it is confined to shares that are exclusively
accessed by a single user, or by only one user at a time. Because the true value of
opportunistic locking is the local client caching of data, any operation that interrupts the
caching mechanism will cause a delay.
Home directories are the most obvious examples of where the performance benefit of
opportunistic locking can be safely realized.
4.2 Multiple-Accessed Shares or Files
As each additional user accesses a file in a share with opportunistic locking enabled, the
potential for delays and resulting perceived poor performance increases. When multiple
users are accessing a file on a share that has oplocks enabled, the management impact of
sending and receiving oplock breaks, and the resulting latency while other clients wait for
the caching client to flush data, offset the performance gains of the caching user.
As each additional client attempts to access a file with oplocks set, the potential performance
improvement is negated and eventually results in a performance bottleneck.