GEEDEE REALTY SYSTEMS
Write-behind Caching
Real Estate Software by Real Estate Professionals
Versions of Microsoft®Windows published since the year 2000 have a feature called 'write-behind caching' and by default, it is enabled. The intention was to speed up operations, but read on...
Microsoft® introduced an operation system feature in Windows that caches file handles called RFCB Caching. This was done in order to increase the file handling performance of specific kinds of windows based applications. This feature was found to cause problems with client/server based applications and server based application programs such as the GeeDee Realty System package.
The technical explanation of this is as follows: NT service cache file handles (RFCBs) associated with files it has opened on behalf of a client (workstation) request. Although write requests proceed normally, close requests that are acknowledged by the server, but buffered from the file system. This is intended to optimise response time to repeated open/close operations performed by clients (which the GeeDee Realty System program does a great deal of). Additionally, Opportunistic Locking (Oplock) is an optimisation that is a logical extension of the way a client caches its own file close request and relies on the server to arbitrate future requests for file access by other clients, rather than allowing the application to actually close its own file handles.
WARNING:In Windows 2000 (since Service Pack 3), XP and 2003, whenever you install a new Service Pack from Microsoft, it resets this option - turning the Opportunistic Locking back on! This means that after loading any updates from Microsoft, you need to set these options again.
Please see Page 3 “How Microsoft Reacts To This Issue?”
What is write-behind caching?
When you post transactional information in GeeDee, or use the Windows Save... or Save As... options, your intention is to write your work to a disk drive - either a local or a Network Server Drive. What recent Windows systems actually do is 'make a note of the fact' that your intention is to create or modify a disk file, then save your information somewhere in memory, and only actually write it to the disk drive at some later time. It is part of this caching system that a program is unable to determine that this is going on, and so your program, in this case the GeeDee Software, like ALL Server Based Applications, is 'convinced' that it has successfully committed your work to disk when in fact it's sitting someplace else, and potentially vulnerable to loss or corruption.
Since for most people the increase in performance is actually negligible, the risk of data loss far outweighs any benefit. We therefore advise that you disable write-behind caching on all your disk drives. You'll find instructions below for Windows 98, NT, Me, XP, 2000-2003.
When you change a record and assume it is written to disk, the operating system may hold on to it for a while waiting for an opportunity of less activity to do the actual writing. With a database this may be observed when you make a change on one workstation, like adding a receipt, but the receipt does not show up immediately on other workstations using the same program and database. This is especially noticeable when the network is busy as:
- your own workstation may first wait for an opportunity to tell the server to write it to its hard disk, and
- when the server has confirmed that it has written it to the hard drive it may decide to also wait for a lull in activity before it actually finally writes it to disk.
Other transactions may be posted by other users that invalidates your data, like paying an owner when you have already used the funds to pay a creditor. As your transaction has not been written to disk yet, other users have no way of knowing that the funds are not available anymore. Disabling write-behind caching forces the operating system to immediately write the record to disk. This may still take a second or two on a slow network but is much safer for your precious data!
How might this affect you?
We have had a number of reports of problems with GeeDeeletters, notes and workorders that we think are caused by (or at least related to) this issue. In some cases the letters, notes and workorders in question disappear, so this can be a very serious issue. The problem usually shows itself whereletters, notes and workorders that were filed in one session had disappeared and when trying to load it in the next session could not be located.
A related problem concern is when data is not displaying correctly and will not refresh as it should within the main GeeDee Desktop.
Disabling write behind caching
The following information is taken from an article on the web site of the Government Australia Dept. of Education and Children's Services, School Library Software Support Centre IT Services, Australia.
"Most Windows systems, by default, have write-behind caching enabled. This speeds up disk-write operations by holding data in memory until the computer thinks it is the right time to write it to disk.
This same system can also cause conflicts with shared files and networked software .... Because the data is not being written directly to the hard drive on the spot, delays imposed by caching can cause a server or workstation to become confused and to cause data corruption.
If this happens, the computer’s 'disk write caching' functions should be disabled.
The process to disable write caching is different for various versions of Windows.
Windows 2000 & 2003
Start at the desktop.
Right-click on My Computer, then left-click on Properties.
Click on the Hardware tab at the top.
Click on the Device Manager button.
Click on the + next to Disk Drives to expand it.
Right click on the hard drive on which to turn write caching off, then left click Properties.
Click on the Disk Properties tab.
Click on Write Cache Enabled to remove the tick. It must not be ticked.
Click OK.
Windows XP
Start at the desktop.
Right-click on My Computer, then left-click on Properties.
Click on the Hardware tab at the top.
Click on the Device Manager button.
Click on the + next to Disk Drives to expand it.
Right click on the hard drive on which to turn write caching off, then left click Properties.
Click on the Policies tab.
Click on Enable write caching on the disk to remove the tick. It must not be ticked.
Click OK.
Windows 95/98/Me
Start at the desktop.
Right-click on My Computer, then left-click on Properties.
Click on the Performance tab at the top.
Click on the File System button at the bottom.
Click on the Troubleshooting tab at the top.
Click on Disable write-behind caching for all drives to put a tick next to it.
Make sure it is ticked.
Click on OK to close the File System window.
Click on OK to close the System Properties window.
Windows NT4
As far as we know there is no user interface provided to the write-behind caching feature in Windows NT. Data from Microsoft® suggest that you need to ensure that you are using Service Pack 4 or later, and that you need to check the value of the registry entry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Rdr\Parameters\UseWriteBehind
The value 0 (zero) disables write behind caching. It is not clear what state the system is in if this key is not present.
We do not encourage you to edit the registry. Messing with the registry is not a good idea unless you are confident that you know what you are doing. Making incorrect registry entries can cause your Windows operating system, or application programs, to act improperly or stop working. We make no warranties for the instructions given in the Microsoft® article referenced above, or for the registry entries reproduced on this (or any other) web page. You agree to make any and all registry changes at your own risk. Consult your local I.T. expert!
Smartdrive
Windows 95, 98 and ME can be set to start the computer by using the Config.Sys and Autoexec.Bat files. The Smartdrive facility can be included here, which also can control write-behind caching. It is a good idea to have these files on the computer on Win 95/98 systems.
A related tech note appears on the Microsoft® site. This is a vast site, and it can be difficult to find things on it, so here's a portion of the relevant information:
"The Windows IDE Hard Drive Cache Package provides a workaround for computers running Windows Millennium with Integrated Drive Electronics (IDE) hard drives, large caches, and modern processors. IDE hard drives store data in a hardware cache (temporary memory) and write the data to the hard disk later. For these computers, data can be lost during
the shutdown process because the amount of time that it takes for fast processors to shut down is so short that the hard disk may shut down before the data in the cache is written to the hard drive. This update introduces a two second delay in the shutdown process, which allows the hard drive's cache to write any data to the hard drive. Download now to delay your shutdown process slightly to prevent data loss."
How Microsoft Reacts To This Issue?
Opportunistic locks where introduced by Microsoft to increase performance of network applications when it comes to file sharing. The strategy used significantly decreases performance of file-based database applications. The oplock can easily and safely be disabled via a registry-key setting change. After disabling of oplocks your database application should show increased performance and higher reliability. Other applications may but typically do not encounter performance penalties. The only potential drawback of disabling oplocks is a potential higher bandwidth usage when it comes to standard file usage such as opening/closing/reading/writing office documents.
You can find various MS KnowledgeBase articles about this issue. MS has officially confirmed that the default oplock configuration is a problem for "DOS" style database applications. However, understanding the Microsoft terminology is critical here:
1. The term "application-based databases" refers to all file-based database applications. Because they perform a so called heavy concurrency patterns.
2. MS has no strategic interest in resolving this problem, specifically in the context of the MS-Access, Borland (BDE) and Jet-DatabaseEngine users community. Because now they can talk them into using newer MS-SQL products instead of resolving the performance and reliability problems.
WARNING:In Windows 2000 (since Service Pack 3), XP and 2003, whenever you install a new Service Pack from Microsoft, it resets this option - turning the Opportunistic Locking back on! This means that after loading any updates from Microsoft, you need to set these options again.
FIX: To resolve and fix this Service Pack change please re-run the SetupGD.EXE / Workstation Type install again.
The registry entries that affect Opportunistic Locking are as follows (all are DWORD entries).
Server:
Key:HKEY_LOCAL_MACHINE\ SYSTEM\ CurrentControlSet\ Services\ LanmanServer\ Parameters
Value name:EnableOpLocks
Value data:0
Workstations:
Key:HKEY_LOCAL_MACHINE\ System\ CurrentControlSet\ Services\ MRXSmb\ Parameters\
Value name:OplocksDisabled
Value data:1
Key:HKEY_LOCAL_MACHINE\ SYSTEM\ CurrentControlSet\ Services\ LanmanWorkstation\ Parameters
Value name:UseOpportunisticLocking
Value data:0
Note: These entries may not exist by default.
At best your network performance is sluggish, at worst you encounter problems with an open file shared by the GeeDee Realty System such as:
- System freezing/Locking up;
- Access Violations;
- The file is in use;
- The file is already open;
- Unable to write to drive G:\;
- The network drive G:\ is no longer available;
- Data loss and Data refresh problems;
- Data corruption - file size inconsistency.
The following MS KnowledgeBase articles are listed here only for interest:
Q812937File Lock or Access Denied Error Message When You Save Files Over the Network
When you try to save a file that you opened by using a universal naming convention (UNC) path, you may receive an error message….
Q126026 Server Optimization in RFCB Caching
If you have encountered problems when opening files located on a server. This article describes how to detect if the problem is related to oplocks and the CachedOpenLimit configuration parameter.
Q129202 Explanation of Opportunistic Locking on Windows NT
This article describes additional configuration parameters regarding oplocks. The article is valid for NT/2000 and XP.
Q163525 Delay When Saving Word File to Windows NT 4.0 Server
Even MS Word and other Office applications may run into performance problems with the oplock solution by Microsoft.
Q163525 Delay When Saving Word File to Windows NT Server
FYI: Office 2000 has problems with oplocks too! You are not alone!
Copyright Notice
Trademarks
MS Windows, MS Operating Systems, Microsoft® are registered trademarks of Microsoft® Corporation.
Disclaimer
This guideline has been validated and reviewed only for use for the supplied version of the 'GeeDee Realty System' software. It is subject to changes without notice. GeeDee assumes no liability for damages incurred directly or indirectly from error, omissions or discrepancies between the program and all the guidelines.
Specialising in Trust Accounting and Property Management Systems
Page 1 of 4
J:\--- GD Booklet ---\CD-ROM Install Doc PDF Notes