Problem
What are opportunistic locks ? Solution
An opportunistic lock is a performance enhancement that
was implemented into the SMB protocol several years ago.
The way in which an opportunistic lock works is as
follows. When a client opens a file, the protocol will
automatically lock it in order to prevent other processes
from writing to it. Once it has the file locked, the
client is able to be flexible about how it does its reads
and writes to the file.This method of locking is called 'opportunistic' because
the user has not actually requested a file lock. LAN Manager
does it on the user's behalf.With the file safely locked, the client can cache data.
For instance, if the user requests a 1 byte read, the client
can actually read 1K, or 4K, and cache the data locally to
satisfy potential future reads. The same is true for writes.
A small write does not have to go over the network; it goes
into a cache on the client side. Four 1K writes is a major
performance loss compared with one 4K write.Opportunistic locks Implementation
---------------------------------------------------------------------------------------
Product Opportunistic Locks Support
-----------------------------------------------------
Lan Manager 1.x Yes
-----------------------------------------------------
Lan Manager 2.x No
-----------------------------------------------------In order to improve the performance of file access on a Lan Manager 2.x server (for example, when loading an application like MS Winword from the server), the application files on the server can be made read-only as a workaround.
Opportunistic locks will be implemented in a future release of the product.