Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1492
  • Last Modified:

Multi-User very SLOW

A user of one of our programs is able to update and save very quickly (although not as quick as others) UNTIL another user logs onto the database.  She becomes unacceptably slow.  The other users are not really affected, although they are a little slower in multi-user mode.

Any ideas?
0
fmoore0001
Asked:
fmoore0001
  • 5
  • 3
  • 2
2 Solutions
 
pcelbaCommented:
The application cannot be the problem source most probably because I suppose it is installed same way at each workstation.

Ask users to swap their workstations. If the problem persists then check network hardware and connection of the problematic workstation. WKST reinstallation is the last attempt to fix the problem.

It could also be caused by some setting in user profile. The easiest solution is to create a new user in such case.
0
 
Olaf DoschkeSoftware DeveloperCommented:
Nothing within VFP. Opportunistic locking, an OS level setting. All file based databases like foxpro and other isam databases, access and other are affected. This needs to be turned off.

This can only be turned off when using SMB1 instead of SMB2. It's not only a PITA because of the slow down, it also is a reason for corrupt dbf headers and indexes.

Here's the longwinded explaination and how tos: http://www.dataaccess.com/whitepapers/opportunlockingreadcaching.html

Besides turning off opportunistic locking, Index your data appropriately to support rushmore optimization.

Bye, Olaf.
0
 
pcelbaCommented:
Olaf, why oplocks disabling should speed the app up? I would suppose opposite effect.
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
fmoore0001Author Commented:
Guys,

I found the solution, and not one you would necessary expect, from a Carl Warner notation in another areas.

Visual Foxpro apparently has some problems with large memory and paging, where it is attempting to balance RAM in physical memory and disk memory, and the setup for the disk memory is slowing it down because it has so much available on modern computers.  I guess Bill Gates still thinks 640K is plenty of memory for a computer (he actually said this).

In any case, use the command =SYS(3050, 1, 100000) to set the memory limit to 10 megabytes.  This will force the program to use the physical instead of disk memory.  As soon as I did  this the program kicked into high gear again.  Whoda thunk it?

The Microsoft article is at:
http://support.microsoft.com/default.aspx?scid=kb;en-us;176483&Product=fox
0
 
fmoore0001Author Commented:
Thanks guys.
0
 
Olaf DoschkeSoftware DeveloperCommented:
Why oplocks do slow down? Well, you see a slowdown when secondary users come into the system. Oplocks explains that, because the mechanism cahes files (whole files) for the first user as long as it's the only user and enables that single user to use a file as if it had exclusive access to the file and the file as local.

That's making it fast until the lock is broken by a second user wanting access to the same file. When the lock is broken all cached differences are written which slows down the process for that first user and others.

Bye, Olaf.
0
 
pcelbaCommented:
Yes, that could explain slownest for all users accessing the same file but not the only one user.
0
 
pcelbaCommented:
SYS(3050,1,10000000) is very close to switching the cache off which results into less effect of oplocks and it could explain the speed improvement.

But still, I have to say, the solution is a kind of magic and it would need some more investigations...
0
 
Olaf DoschkeSoftware DeveloperCommented:
No, the foxpro cache has nothing to do with oplocks, oplocks and read ahead caching is done outside of the foxpro runtime and not influenced by minimizing  the foxpro cache. Oplocks are also not to be confused with foxpros record locking or buffering techniques.

I can only say that I already got a few feedbacks confirming turning off oplocks help. You may simply do so and observe if behaviour changes.

Bad news is that once oplocks is turned off the first user of the system does not have the speedup oplocks do provide, but that's not very tragical as long as the overall performance is okay by indexes and rushmore optimization. Unfortunately the benefit is lost, but the overall better performance for file based databases is without oplocks. oplocks do help quite good for editing word docs stored on a network share, where it's typical only one user has write access anyway, but it's causing more problems than benefits for files in concurrent use.

What I never did was use some tcp/ip paket sniffer and compare network traffic with and without oplocks enabled. I'm pretty sure that would shed a light on the mechanism and what exactly happens, when the oplock is broken. You may give that a try. Wireshark is one recommendable paket sniffer, you also need to install winpcap, but wireshark will also tell you. It's easy to use, you filter for eg SMB packets and log them. Then do some operations on a dbf from one client alone, then do something on a secon client and do that with and without oplocks enabled to see what differs.

Bye, Olaf.
0
 
pcelbaCommented:
So, what we would need is to selectively set oplocks for certain files (or folders) only. I hope MSFT will allow it in the future.

Thanks for the explanation Olaf.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 5
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now