Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP9 sp2 bad performance on Windows 11

Status
Not open for further replies.

Dan Olsson

Programmer
Aug 6, 2002
187
0
16
SE
I have about 50 places around Sweden, all of them set up similarly. EVERYTHING is on the server and clients only have a shortcut (via a network drive) to the EXE on the server.
One client in one place was foolish enough to answer Yes when her PC wanted to "update" itself to 11. After that her PC (and only hers) became unbearably slow. Her estimate is 3 times slower.
I have done some research and it might be that W11 tries to shut down SMB1, but I imagine networking wouldn't work at all if so. Any hints would be appreciated!
 
VFP has problems with SMB1, but it does not stop working when it's off. In fact, it is off by now and not enforcible unless you revert to old servers. The clients can be anything in that respect.

Have you even done some analysis of what exactly is slow on that one client, now?

Chriss
 
Well,

thinking about a situation where all clients are configured to use SMB1 and only the one rogue win11 client does not have that on anymore. The result is that this one client will not only support but also use opportunistic locking. That would result in it being the only client that will gain virtually exclusive access to DBFs on the network and be faster than all other clients, not slower. The moment this stops is when the access of another client breaks this opportunistic lock and this win11 client has to write back all changes to the network. The nature of this is the other clients then have to wait when that happens as any write operation the wi11 client did - in the knowledge no other process anywhere else even reads the DBFs - were cached locally. That's the nature of opportunistic locks, it's a caching mechanism, mainly. the lock on the file is a breakable lock, even a simple read access from anyone else breaks this and triggers the OS file system to call out to the client with the oplock to write back its cached changes so it can deliver it to the other client that demands it. So all in all it's a lazy network file syncing mechanism.

By the nature of this one client becoming slower than all others, it will be something else than SMB1.

MS said:
Microsoft publicly deprecated the SMBv1 protocol in 2014.
taken from
Also readd the section about the new leasing mode:

Leasing mode
If SMBv1 is required to provide application compatibility for legacy software behavior, such as a requirement to disable oplocks, Windows provides a new SMB share flag that's known as Leasing mode. This flag specifies whether a share disables modern SMB semantics such as leases and oplocks.

You can specify a share without using oplocks or leasing to allow a legacy application to work with SMBv2 or a later version. To do this, use the New-SmbShare or Set-SmbShare PowerShell cmdlets together with the -LeasingMode None parameter.

So you can create a network share for your DBFs that will let it work without oplocks even though you still use SMBv2 or higher. There's no need to revert to SMB1 to turn oplocks off. I doubt this will change anything, as the natre of oplocks will make the one client that uses them perform better, not worse. But you cold try and see if that changes things back to normal.

You just will need to find a timeslot to do this and replace the old file share with one you create that way. It's a central server side solution for this not needing clients to have SMBv1 installed not registry keys enforcing it.

I would recommend not to start an EXE put on a server share anyway, but you find that many times already discussed with solutions on how to make it a local EXE copy that upgrades.

Chriss
 
Chris Miller said:
I would recommend not to start an EXE put on a server share anyway, but you find that many times already discussed with solutions on how to make it a local EXE copy that upgrades.
Yes, I know all about the arguments for that, but since the DBFs are on the network share anyway, it wouldn't help in this case, right?
 
Yes, it helps.

Of course in any application with shared data the DBFs are on a share, but removing the EXE from the share you remove the network load about it. Of course that helps.
Network access to files in general hasn't changed from win10 to win11. I guess if win11 upgrade was an automatic option you did use win10. There has to be another reason for the change. And smb1 wold be the same problem in win10.

Chriss
 
Dan , I have another solution, but it is much worst than the first I suggested
Do you want to read it ?
( please say No )
 
I run Windows 11, and I have a routine that enables SMB1 every hour - because M$ in their wisdom like to turn it off
even if you turn it on (bit like the Windows Update).

Windows 11 is also not terribly good in terms of network performance - in my experience - so running a .exe from
the server is going to give you poor response times, better to copy to your local drive and work from there.

This leaves aside the lovely people at M$ knobbling, hobbling perhaps, the ability to print logos and the like
stored in general fields...

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

There is no place like G28 X0 Y0 Z0
 
okarl said:
Dan , I have another solution, but it is much worst than the first I suggested
Do you want to read it ?
( please say No )

YES, I want to read it [dazed]
 
Chris,

to avoid SMB2/3-problems with DBFs on Windows 10/11 I changed the default settings on all computers on the network (clients and server). I summarized the default settings and the new settings below:

DEFAULT SETTINGS

SMB Client Configuration:
set-smbclientconfiguration -DirectoryCacheLifetime 10
set-smbclientconfiguration -FileInfoCacheLifetime 10
set-smbclientconfiguration -FileNotFoundCacheLifetime 5
Set-SmbClientConfiguration -KeepConn 600
Set-SmbClientConfiguration -SessionTimeout 60
Set-SmbClientConfiguration -UseOpportunisticLocking $True

SMB Server Configuration:
set-SmbServerConfiguration -AutoDisconnectTimeout 15
set-SmbServerConfiguration -EnableLeasing $True


NEW SETTINGS

SMB Client Configuration:
set-smbclientconfiguration -DirectoryCacheLifetime 0
set-smbclientconfiguration -FileInfoCacheLifetime 0
set-smbclientconfiguration -FileNotFoundCacheLifetime 0
Set-SmbClientConfiguration -KeepConn 65535
Set-SmbClientConfiguration -SessionTimeout 65535
Set-SmbClientConfiguration -UseOpportunisticLocking $False

SMB Server Configuration:
set-SmbServerConfiguration -AutoDisconnectTimeout 999999
set-SmbServerConfiguration -EnableLeasing $False


Do you think the new settings make sense, including turning off Opportunistic Locking (Set-SmbClientConfiguration -UseOpportunisticLocking $False)?

Thanks,
Manni


 
@Griff: How do you enable SMB1 on Windows 11, I thought it's not possible?

Thanks,
Manni

 
I already told the solution to the SMB oplocks problem is the new leasing mode. See above.

Chriss
 
I have this as a scheduled activity after the hour every hour

Code:
@echo off
SC stop wuauserv
sc config wuauserv start= disabled
DISM /Online /Enable-Feature /All /FeatureName:SMB1Protocol
dism /online /disable-feature /featurename:SMB1Protocol-Deprecation
timeout /t 300

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

There is no place like G28 X0 Y0 Z0
 
Despite the above, M$ still gets the odd update through...

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

There is no place like G28 X0 Y0 Z0
 
Chriss, sorry, I first missed that part. So using "Set-SmbShare ... -LeasingMode None" on the computer with the DBFs is enough and you don't have to change any other SMB Configurations in my above post?

In the past especially these three settings have often been recommended:

set-smbclientconfiguration -DirectoryCacheLifetime 0
set-smbclientconfiguration -FileInfoCacheLifetime 0
set-smbclientconfiguration -FileNotFoundCacheLifetime 0

Regards,
Manni

 
Yes, these three settings are just making SMB with oplocks as bearable as you can, by practically turning off caching via setting the lifetime to 0.

But with the new modes that allow you to opt out of leasing, you don't need SMBv1 anymore, you just have a share that's working as it was before these counterproductive features were introduced. What performance you get then just depends on your knowledge of rushmore and indexing of the DBFs. I have long time not maintained a VFP database-based application, I use SQL Server backends. So for practical experience, you have to test it for yourself, sorry.

Chriss
 
I enable SMBv1 to access hardware that doesn't support anything newer... and I do it hourly because if you don't
use it for a little while, blessed Windows turns it off again!

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

There is no place like G28 X0 Y0 Z0
 
@Griff
Thank you for sharing the code. I'm afraid though, turning SMB1 on is not as reliable in the future as using the options for SMB2/3 provided by MS/powershell.

@Chriss
Than you for your explanation. Do I have to use "Set-SmbShare ... -LeasingMode None" setting only on the computer, where the DBF files alre located? Antoher problem is you have to know the network share, so it's hard to automate it in the shipped application, because you don't know if a share was configured only for the folder containing DBFs or the whole C:\ drive for example. So it has to be configured manually.

Instead setting the caching times on all clients are st to 0 via set-smbclientconfiguration seems more practical to me. I wonder if it can have the same negative side effects like turning LesaungMode to none which the Microsoft article you posted warns about. Othersise it would be great to run it on every client computer during installation of the application.

 
Please read about it, you're making this a share with thtat property to not use the SMB features that are counterproductive, So it solves it for every client.

MS said:
You can specify a share without using oplocks or leasing to allow a legacy application to work with SMBv2 or a later version.

Simply try it. It takes you less time to simply try it for yourself than asking the same question "does it work?" over and over in disguise.

Do it.

Chriss
 
Chriss, I don't know why you're accusing me of asking questions in disguise, that's not what I'm doing.

I'm looking for a solution which can be shipped with the application so problems with SMB don't appear. One solution would be to turn cashing times to 0 on all clients during installation of the application. It works fine in my network but how can I know that it won't do harm on customers networks where there might be other applications running? In the end I guess I have try it and if problems appear provide an option to reset the Cashing times again.

Instead turning LeasingMode None just for the network shrare where DBF files are seems like the ideal solution, but requires knowing the network shares so it has to be configured manually.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top