[Samba] Slower performance on oplock

Li, Ying (ESG) ying.li2 at hp.com
Sat Feb 16 00:33:38 GMT 2008


Hello,

We are running into the problem in slower performance on oplock.
Here is the oplock scenario.

- We are using 3.0.22.
- Kernel oplock has been implemented on hp-ux 11v3.
- smb.conf
        kernel oplocks = Yes
        oplock break wait time = 0
        fake oplocks = No
        locking = Yes
        oplocks = Yes
        level2 oplocks = Yes
        oplock contention limit = 2
        posix locking = Yes
- Running a Windows application that have to access to data on Samba share.
- Read data is ok.
- A single user to write data is ok.
- Multiple users to write data experience oplock delay. For example, two clients tried to edit data at the same time in the application, there are following processing from my observation:
  * The first open on a file with an exclusive oplock.
  * The second open on the same file needs to call defer_open() and send oplock break msg to itself.
  * Most of time, the msg can be received. Performance is OK. But sometimes for some reason, the msg couldn't be received. I don't know why. So there was a delay(probably 60s) after open_was_deferred(). After this, Windows client tried to send SMBntcreate to open it again. This time still failed. Since we have "Trying to delay for oplocks twice" in open_file_ntcreate(), it leaded to close the connection.

- Whether IS the defer_open on the second open necessary? Because this is the same process, and the same file.
- What kind of reasons to cause the smbd did not receive the break msg?
- Is there any way to remove the delay, or a specific fix around this?

Any help greatly appreciated.

Thanks very much.
-Ying


More information about the samba mailing list