SCSI Write Cache Utility -- David Adams, CTOS Technical Support San Jose, California Version 1.0-20JUN96 Files in the Superzip archive: ScsiWriteCache.run - run file for the utility. ScsiWriteCacheCmd.sub - submit file to build new command. ScsiWriteCache.txt - this documentation file. The utility is used to manipulate the "Write Cache Enable" bit on a SCSI disk drive. The latest SCSI disk drives that are being shipped by Unisys have the "Write Cache Enable" bit turned OFF when they go to customers. This defeats the on-board cache that is present on most modern SCSI disk drives. The reason for this is that RAID devices require that the cache bit be turned OFF in order to provide the reliability that RAID advertises. All SCSI drives that come with Unisys products are received from the vendor with the "Write Cache Enable" bit turned OFF so that if they are installed in a RAID package, they will operate correctly in that environment. However, in a CTOS (or MS-DOS, Windows/NT, etc.) environment, it is advantageous to have the "Write Cache Enable" bit turned ON, which allows the built-in cache on the disk to accept the data written to the disk, rather than to wait for the write operation to complete before the operation ends. The performance difference can be dramatic. One of our customers measured a simple write operation (repeated many times), and on a disk with the cache ENABLED, the program took about 30 seconds. With the cache DISABLED, the same program ran in about 2 1/2 MINUTES ! Quite a performance hit. To use the utility, copy the run file to the [Sys] directory, and submit the file that constructs the new command. The command form appears as: SCSI Write Cache Utility [CTOS Drive (e.g. D0, D1, ...] [Enable Cache on device?] and the parameters are apparent. However, if you supply NO parameters, then the program simply lists all of the SCSI disk drives that are attached to the processor. To enable the cache on a particular drive, supply the appropriate drive specification and answer "Yes" to the second parameter. To disable the drive's cache, answer "No" to the second parameter. If you specify something other than "Y" or "N" (or other variant of Yes or No) then the program will not modify anything, but will simply display all drives on the machine. This program will NOT work correctly on SG-5000 or B39 machines on drives connected to a SECOND SCSI controller. It will work correctly if the drives are "expansion" drives, operating off the first controller (on the motherboard of the processor). Finally, some older SCSI drives do not allow you to modify the "Write Cache Enable" bit. If you run into one of these drives, the utility will display an error message, generally erc 2 (end of medium). No harm will be done, but no change will be made to the drive, either. ******************************************************************************* *** Special Considerations for ISAM III databases, control and audit files on SCSI disks !!! ISAM III supports complete transaction integrity and relies on the assumption that when the operating system indicates a write has been completed that the data has in fact been written to the disk. This is not necessarily the case when the SCSI disk device cache is active. Enabling the SCSI cache leaves open the possibility that you can lose transactions or corrupt your database in a power failure (software system failures will have no impact on the SCSI disk cache). Scott Kurowski's paper 'An Inside Look at CTOS ISAM III' discusses this topic much more in depth, and recommends that the CTOS operating system delayed-write cache not be used for ISAM III. This recommendation also holds for SCSI cache. If you have a UPS for your system, this risk is extremely low and it will probably be safe to enable the SCSI disk cache.