` Printed Icetips Article

Icetips Article



Windows Operating Systems: Set OpLocks to improve performance
2004-03-06 -- Peter Kirk
 
Newsgroups: softvelocity.public.clarion6

There are three keys that need to be set on all workstations and servers.

HKEY_LOCAL_MACHINE/System/CurrentControlSet/Services/LanmanServer/Parameters
          EnableOpLocks = 0 (hex)
          EnableOpLockForceClose = 1 (hex)
          CachedOpenLimit = 0 (hex)

You should also disable write-behind caching on Win98/ME workstations.  The
following setting corresponds to the "System Properties / Performance / File
System / Troubleshooting / Disable write-behind caching for all drives"
checkbox.

HKey_Local_Machine \ System \ CurrentControlSet \ Control \ FileSystem \
DriveWriteBehind=0.

Peter Kirk


"dave wilkin" <[spam]david.wilkin@ntlworld.com> wrote in message
news:A921.1078525501.4007@discuss.softvelocity.com...
> The EnableOplocks value is set to 1
>
> l_EnableOplocks = 1
>
>
> "Peter Kirk"  wrote in message
> news:A921.1078381798.3117@discuss.softvelocity.com...
> > How is opportunistic locking disabled?
> >
> > > > KB Article R10200  -
> > Redirector
> > > > Problems and Other Network Problems
> >
> > To do so, you can use our REDRTEST.EXE utility program on a Windows
> > NT/2000/XP Server or you can edit the Registry (on the NT/2000/XP
> server)".
> >
> >
>
HKEY_LOCAL_MACHINE/System/CurrentControlSet/Services/LanmanServer/Parameters
> >           EnableOpLocks = 0 (hex)
> >           EnableOpLockForceClose = 1 (hex)
> >           CachedOpenLimit = 0 (hex)
> >
> > Note: The above values should be added as DWORD values if not present.
> >
> > You need to dissable Read ahead caching as well as the oplocks..
> >
> > Get hold of RedTest and read the articles I mentioned.  I have used it
on
> > Win98, NT4, Win2000, Win2000 Server, XP, Windows 2003 Server.
> >
> > Peter Kirk
> >
> >
> >
> > "dave wilkin" <[spam]david.wilkin@ntlworld.com> wrote in message
> > news:A921.1078341577.2887@discuss.softvelocity.com...
> > > Hi Peter,
> > >
> > > I used the Jeff Jones templates to produce the following code, but I
do
> > not
> > > know if the server/workstations have to be rebooted ?
> > >
> > > The value EnableOplocks is toggled on and off, and created if missing.
I
> > > need to test this to see if there are any performance gains
> > >
> > > ToggleOnOportunisticLocking Routine
> > >
> > >   ! Start of Procedure for Main Frame
> > >
> > >   !
> > >
> >
>
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters
> > > \EnableOplocks
> > >
> > >   ! Open the Registry Key for use
> > >   l_subkey =
'SYSTEM\CurrentControlSet\Services\lanmanserver\parameters'
> > >   l_ProgramKey = OpenKey(HKEY_LOCAL_MACHINE,l_subkey)
> > >
> > >   ! Check the registry value
> > >   l_EnableOplocks = GetValue(l_ProgramKey,'EnableOplocks')
> > >   if l_EnableOplocks <> 0 then
> > >     OL_Toggled = False ! prohibits toggling off Oportunistic Locking
if
> it
> > > were not toggled off at the start of the procedure
> > >   else
> > >     l_EnableOplocks = 1
> > >     PutValue(l_ProgramKey,l_EnableOplocks,'EnableOplocks',Reg:Long)
> > >     OL_Toggled = True  ! permits toggling off Oportunistic Locking if
it
> > > were toggled off at the start of the procedure
> > >   end
> > >
> > >   ! Close the Registry Key for use
> > >   CloseKey(l_ProgramKey)
> > >
> > > ToggleOffOportunisticLocking Routine
> > >
> > >   ! End of Procedure for Main Frame
> > >
> > >   if OL_Toggled then
> > >     !
> > >
> >
>
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters
> > > \EnableOplocks
> > >
> > >     ! Open the Registry Key for use
> > >     l_subkey =
> 'SYSTEM\CurrentControlSet\Services\lanmanserver\parameters'
> > >     l_ProgramKey = OpenKey(HKEY_LOCAL_MACHINE,l_subkey)
> > >
> > >     ! Check the registry value
> > >     l_EnableOplocks = GetValue(l_ProgramKey,'EnableOplocks')
> > >     if l_EnableOplocks <> 0 then
> > >       l_EnableOplocks = 0
> > >       PutValue(l_ProgramKey,l_EnableOplocks,'EnableOplocks',Reg:Long)
> > >     end
> > >
> > >     ! Close the Registry Key for use
> > >     CloseKey(l_ProgramKey)
> > >   end
> > >
> > >
> > > "Peter Kirk"  wrote in message
> > > news:A921.1078316511.2717@discuss.softvelocity.com...
> > > > I did my fiddling with the REDRTEST.EXE utility program available on
> the
> > > > following site..  Worked fine for me..
> > > >
> > > >     
> > > >
> > > > Run it on your server and on all workstations to disable oplocks and
> > file
> > > > caching..  Remember to turn of write-behind caching on your
> > workstations.
> > > >
> > > > If you are still having problems. then the following resource might
> > prove
> > > > helpful..
> > > >
> > > > KB Article R10200  -
> > Redirector
> > > > Problems and Other Network Problems
> > > >
> > > > Peter Kirk
> > > >
> > > >
> > > >
> > > > "dave wilkin" <[spam]david.wilkin@ntlworld.com> wrote in message
> > > > news:A921.1078258954.2493@discuss.softvelocity.com...
> > > > > Hi,
> > > > >
> > > > > I have posted this in the comp.lang.clarion group as well.
> > > > >
> > > > > I have similar problems;
> > > > >
> > > > > http://ourworld.compuserve.com/homepages/jeffnjones/
> > > > >
> > > > > there may be a solution here. I am investigating !
> > > > >
> > > > > dave
> > > > >
> > > > > "Bernard Legros"  wrote in message
> > > > > news:A921.1078033619.1590@discuss.softvelocity.com...
> > > > > > Hi,
> > > > > >
> > > > > > And how do you "automatically fiddle" ?
> > > > > >
> > > > > > Thanks
> > > > > > Bernard
> > > > > >
> > > > > >
> > > > > > "robert paresi"  a écrit dans le message
> news:
> > > > > > A921.1078024141.1570@discuss.softvelocity.com...
> > > > > > > When my program runs, I automatically fiddle with the registry
> for
> > > > > > > Opportunistic File Locking (On NT and 2000 machines).  I've
been
> > > doing
> > > > > > this
> > > > > > > for many years.
> > > > > > >
> > > > > > > I am unaware if the registry key location has changed in 2003
> > > Server.
> > > > > If
> > > > > > it
> > > > > > > has, can someone let me know.
> > > > > > >
> > > > > > > Thank you.
> > > > > > >
> > > > > > > -Robert
> > > > > > >
> > > > > > > "AndThis>customapps.com customapps.com >" <"AndThis> wrote in
> > > message
> > > > > > > news:A921.1078022983.1565@discuss.softvelocity.com...
> > > > > > > > Seems Clarion isn't the only one to suffer:
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > >
> > ***********************************************************************
> > > > > > > > Windows 2003 Gotcha: Opportunistic File Locking
> > > > > > > >
> > > > > > > > With the release of a new server OS there is always
associated
> > joy
> > > > and
> > > > > > > > fear. Here is a horror story for y'all to learn and be
warned.
> > > This
> > > > > was
> > > > > > > > sent in by a subscriber:
> > > > > > > >
> > > > > > > > "I have been running W2K3 since it was a beta and had no
> > problems
> > > > with
> > > > > > > > the OS. I then decided it was becoming time to start
offering
> it
> > > to
> > > > my
> > > > > > > > customers so the first step was to get my office running it
> > first.
> > > I
> > > > > > > > upgraded the servers all to Windows Server 2003 and as with
> most
> > > > > > > > engineers I was rushed back into the wild to fix something
and
> > let
> > > > the
> > > > > > > > office jockeys run on it.
> > > > > > > >
> > > > > > > > I felt that I had a successful migration after a few weeks
so
> I
> > > > moved
> > > > > on
> > > > > > > > to a contract customer of mine that I have had for six
years.
> I
> > > > > upgraded
> > > > > > > > his Dell PowerEdge 1500SC from Windows 2000 Server to 2003
and
> > > > > > > > immediately the users started complaining of problem
accessing
> > > there
> > > > > > > > QuickBooks files, then the no access turned into file
> > corruption.
> > > > This
> > > > > > > > customer also runs a older Paradox database system on the
> server
> > > and
> > > > > > > > files started becoming corrupt with it as well.
> > > > > > > >
> > > > > > > > I ran through the basic troubleshooting, then the second
phase
> > of
> > > > > > > > troubleshooting all with no victory. I called QuickBooks and
> > they
> > > > said
> > > > > > > > must be hardware, I called Dell and the said must be Windows
> > > Server
> > > > > > > > 2003, so I called MS and they said it must be hardware. To
> > shorten
> > > > > this
> > > > > > > > up some I removed Windows 2003 upgrade and reinstalled
Windows
> > > 2000
> > > > > > > > Server and the problems immediately went away. The only
thing
> at
> > > > time
> > > > > my
> > > > > > > > searches on the internet showed had something to do with
> > > > Opportunistic
> > > > > > > > File locking features in Windows, but nothing conclusive to
> me.
> > > > > > > >
> > > > > > > > So I put it on the back burner until yesterday and started
> > > searching
> > > > > > > > again, wow what a difference a month makes, now people all
> over
> > > the
> > > > > > > > place are having the same problems with Windows Server 2003
> and
> > > > > Database
> > > > > > > > applications, it seems opportunistic file locking is the
> > problem,
> > > I
> > > > > > > > found one news group posting where someone stated that Great
> > > Plains
> > > > > was
> > > > > > > > experiencing this problem so I took a shot and called our
> Great
> > > > Plains
> > > > > > > > contact at MS and he stated that MS had patched it for them
> but
> > he
> > > > was
> > > > > > > > not allowed to release it to anyone not running Great
Plains.
> To
> > > > wrap
> > > > > > > > this up Microsoft has let down an engineer that lives and
> > breathes
> > > > > their
> > > > > > > > product, I make my living off of this software and to be
told
> > > first
> > > > > that
> > > > > > > > nothing is wrong (must be hardware) and then told that they
> have
> > a
> > > > fix
> > > > > > > > but it is only for the big clients is not pretty."
> > > > > > > >
> > > > > > > >
> > > ********************************************************************
> > > > > > > >
> > > > > > > > Lee Hydechuk
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> >
> >
> >
>
>
>



Printed November 21, 2024, 4:06 pm
This article has been viewed/printed 35527 times.
Google search has resulted in 3823 hits on this article since January 25, 2004.