Read-Ahead and Write Buffering
Write buffering can speed up the write process. When write buffering is enabled, all writes to the SCSI
disk are first transferred into a buffer. If the write buffer becomes at least half full, or around three
quarters of a second passes with no reads, or if a preset "guaranteed flush" time-out occurs, the
SCZR60.DVR disk driver will begin scanning through the write buffer, finding blocks that need to be
written out to the drive. The algorithm used to flush blocks out to the drive is able to find up to eight
consecutive blocks and write them to the disk drive as a single write command, therefore dramatically
improving system performance.
Another benefit of write buffering is it tends to eliminate duplicate disk writes, such as bitmap updates
during operations such as copying files and tape restores, and prevents head thrashing when reading
through random access data files and writing a sequential file out to the disk (as most report generation
programs do).
Potential Pitfalls
Obviously, there can be problems with write buffering, especially if the system either crashes or is
powered off while writes are pending in the write buffer. If that happens, all pending writes are lost.
Though this sounds like a major problem, it can also happen if write buffering is not enabled. However,
write buffering increases the number of writes at risk. The primary write buffering risks are an errant
software operation or a hardware failure that causes a system crash.
To help reduce the possibility of data loss, certain safeguards have been put in place. Writes are not
buffered indefinitely; they are performed whenever the device is not performing reads. Even if the drive
is busy with read requests, the buffer is still periodically flushed, based on a user definable "absolute
flush time." In addition, if you have a UPS installed and connected to the AM-319-20's UPS status port,
and you experience a power failure and the UPS status port senses a low battery condition, AMOS will
flush and disable the write buffer in preparation for a system shutdown. Also, the MONTST command
automatically flushes the write buffer.
Therefore, you must weigh the potential for data loss (which is always there) versus the dramatic
performance increase seen when using write buffering. If you are worried about the reliability of write
buffering, it may be worth keeping in mind that the AM-520 disk controller has always used write
buffering on a track-by-track basis (however, not quite as efficiently as the AM-176 write buffering
scheme). The SMARTDRV program that comes with MS-DOS does write buffering (you may have
noticed the "Waiting for system shutdown" message when rebooting a PC with CTRL-ALT-DELETE)
and UNIX-based computers have always done it.
Setting Up Write Buffering
To enable write buffering, you must be using the full SCSI dispatcher (SCZR60.SYS). Enable write
buffering by adding parameters to the SYSTEM statement used to load the SCSI disk driver into system
memory. Append "/N" followed by the buffer size and flush period enables write buffering for that
device. The syntax is:
SYSTEM DVR:dev/N buffer-size flush-period
For example:
SYSTEM DVR:DSK/N 200K 60
AM-6000 Computer Owner's Manual, Rev. 00
Page E-3
Need help?
Do you have a question about the AM-6000 and is the answer not in the manual?
Questions and answers