Disabling opportunistic locking on a Windows cluster file share

1,779 views
Skip to first unread message

Mike Leone

unread,
Sep 27, 2022, 10:28:24 AM9/27/22
to NTSysAdmin
So my devs are running some Oracle software (Web Center? Web Logic? they keep using different terms ...). Anyway, they say they need to turn off opportunistic loving at an OS level, if the shared data resides on a CIFS-based share. And it does - it's a Windows 2019 cluster, configured as a file share.

I've found this - 

which indicates how to use a registry entry to turn off oplocks on Windows.

Anyone ever done this? More - ever done this on a Windows cluster? Did it cause any other havoc?

because (at this moment) this is a on a dev share, I've been told to go and do it. And I will, since if it dies, it's not production. But I'd really like to hear from some one who may have had to do the same.

thanks!


--

Mike. Leone, <mailto:tur...@mike-leone.com>

PGP Fingerprint: 0AA8 DC47 CB63 AE3F C739 6BF9 9AB4 1EF6 5AA5 BCDF
Photo Gallery: <http://www.flickr.com/photos/mikeleonephotos>

This space reserved for future witticisms ...

Michael B. Smith

unread,
Sep 27, 2022, 10:41:04 AM9/27/22
to ntsys...@googlegroups.com

I was somehow under the impression that oplocks only applied to SMB v1. If you are using SMB v1, you’ve got a lot of issues going on…

 

Anyway, use the PS cmdlet "Set-SMBClientConfiguration" which provides the option "UseOpportunisticLocking".

 

It can have a performance impact.

 

Thanks.

 

Regards,

Michael B. Smith

Managing Consultant

Smith Consulting, LLC

--
You received this message because you are subscribed to the Google Groups "ntsysadmin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ntsysadmin+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ntsysadmin/CAHBr%2B%2Bi2jZ29SgzPPfioNFP2za4M5B5xWY6wD_LmrGLGu3EbvA%40mail.gmail.com.

Mike Leone

unread,
Sep 27, 2022, 10:46:41 AM9/27/22
to ntsys...@googlegroups.com
I did not know that! LOL 9about that reg setting being only for SMB v1, which is not enabled, BTW)

Yeah, doing "get-smbclientconfiguration" says "UseOpportunisticLocking" = TRUE. I'll try turning it off ...

Thanks! You are DA MAN!


Mike Leone

unread,
Sep 27, 2022, 10:51:10 AM9/27/22
to ntsys...@googlegroups.com
Ok, I set that, we'll see if it helps.

I also see this:

With the SMB3 Leasing Mode change introduced in Windows 10 build 16215 and Windows Server 2019, there is no longer a need to disable SMB2 and Oplocks.

Setting SMB3 Leasing Mode to none is done on the server via PowerShell with admin rights using the following command

Set-smbshare -name “(Name of the shared folder)” -LeasingMode none


On Tue, Sep 27, 2022 at 10:41 AM Michael B. Smith <mic...@smithcons.com> wrote:

Mike Leone

unread,
Sep 27, 2022, 11:02:49 AM9/27/22
to ntsys...@googlegroups.com
On Tue, Sep 27, 2022 at 10:41 AM Michael B. Smith <mic...@smithcons.com> wrote:

I was somehow under the impression that oplocks only applied to SMB v1. If you are using SMB v1, you’ve got a lot of issues going on…

 

Anyway, use the PS cmdlet "Set-SMBClientConfiguration" which provides the option "UseOpportunisticLocking".


I just realized .. did you mean for me to do this on the server providing the share, or on the Oracle application servers making the connection?
 

Michael B. Smith

unread,
Sep 27, 2022, 11:06:06 AM9/27/22
to ntsys...@googlegroups.com

Set-SMBClientConfiguration is executed on the client computer – that is, the computer requesting the network files.

Mike Leone

unread,
Sep 27, 2022, 11:15:31 AM9/27/22
to ntsys...@googlegroups.com
On Tue, Sep 27, 2022 at 11:06 AM Michael B. Smith <mic...@smithcons.com> wrote:

Set-SMBClientConfiguration is executed on the client computer – that is, the computer requesting the network files.


Gotcha. OK, I've set that on both the Oracle app servers that are making the connection. (UseOpportunisticLocking: $FALSE).I've also set LeasingMode NONE on the server.

That is about all I can do from a locking perspective, at the OS level, on both the clients and the server.

I do see that the Oracle app servers are making a SMB v3.1.1 connection (get-smbconnection), so that means it's using the latest SMB protocol, and I've configured everything I can configure, on both the clients and the server.

 
Reply all
Reply to author
Forward
0 new messages