OpLock, Opportunistic locking (Level I & II) Client File Caching.
(Last modified: 24Mar2005)
This document (10085899) is provided subject to the disclaimer at the end of this document.
OpLock, Opportunistic locking (Level I & Level II) Client File Caching.
Novell NetWare 6.5
Novell NetWare 6
Novell NetWare 5.1
Novell Clients for Windows NT/2000/XP
Novell Clients for Windows 95/98
What is the difference between opportunistic locking and file caching?
Actually they're synonymous, opportunistic locking is a method used for file caching.
If you can't cache the file then there's no oplock available and vice versa.
What is opportunistic locking?
Opportunistic locking is a file access method which allows caching of
a file on a workstation. This method greatly improves performance by limiting
the number of reads/writes that would normally occur across the network.
This is accomplished by using the Cache Manager provide through Microsoft.
The Novell client (NWFS.sys) is oplock aware, if oplock (file caching) is enable on the
workstation then nwfs.sys will invoke the cache manager. Cache Manager limits
the number of packets that actually traverse the network. For instance, an application
may request reads/writes at a data rate of 1 to 8 bytes per packet...this is not optimal.
Cache manager caches the smaller writes and packages a larger data area within the
packet. File read/writes are now optimized so what would normally take hundreds to
thousands of packets can now occur in "tens" of packets. Poorly written applications,
those that transmit small amounts of data, can truly benefit from the optimization provided
by opportunistic locking. When considered, sending 8 byte packets opening a 1024kb file will
generate a host of packets (request - replies -ack's). Application are redirector aware but are
not aware of oplocks or the Cache Manager. Knowing this helps us understand why disabling
"client file caching" on the server sometimes results in extreme performance degradation.
What is the difference between Level I and Level II oplocking?
Level I opportunistic locking provides exclusive caching to the first client accessing the file.
The client is allowed read/writes in an optimized environment. Any subsequent file accesses
by other clients will cause the oplock to be released.
Level I process -
1. The client sends a request to the server (Open file with callback - oplock).
2. Server grants oplock request from client.
3. Another client sends a request to the server to open the same file that the first
client already has opened with an exclusive lock.
4. The server notifies the first client to release the oplock.
5. The first client releases the oplock, now both clients have "regular" non-oplock file access.
Level II opportunistic locking allows the same functionality as Level I but adds enhancements to further optimize
oplock capabilities. Level II allows multiple users to request a file open and read that file
all the while each client has the file cached locally. As you remember Level I only allowed 1
client to access the file, even if the file was only being read. Level II continues to allow clients the ability
to cache locally provided no attempts to 'write' to the file occurs . When the server receives a write request
from any client that has a Level II oplock then all locks are broken (released). The server sends a "server
broadcast" packet directly (this is not a 255 broadcast) to the clients requesting they release their file locks upon a detected write. The "server broadcast"
is necessary because once a write occurs the server can no longer guarantee file integrity, the locks MUST be broken/released.
Level II process (Level I occurs first) -
6. Level II oplock request to server.
7. Server grants Level II request from client.
8. Server detects a write on the file and breaks Level II oplocks (clients which had the file cached)
The Settings for Client and Server are as follows
Client - Novell Client Configuration, Advanced Settings, File Caching=on/off
Server - Set parameters, NCP, Client file caching enabled=on/off
Level 2 oplocks enabled=on/off
Level I & II supported on Legacy volumes - NW5.1 sp6 post filesys and ncp NW6 sp3 post filesys and ncp/NW6.5
Level II supported on NSS volumes - NW6 sp3 post nss patches / NW6.5
The Origin of this information may be internal or external to Novell. Novell makes all reasonable efforts to verify this information. However, the information provided in this document is for your information only. Novell makes no explicit or implied claims to the validity of this information.
Any trademarks referenced in this document are the property of their respective owners. Consult your product manuals for complete trademark information.