Further Study
3
SYSTEM MAINTENANCE AND SUPPORT
Hard drives have come to play an important role in PCsnot just as a storage medium for
programs and files, but as an extension to system RAM. The current generation of graphics-oriented operating systems (e.g., Windows, Win95, Windows NT, OS/2, etc.) make use of drive space as virtual memory. This can dramatically extend the amount of apparent memory available in a system. However, the trend toward very large programs, extensive data files, and virtual memory operations have a disadvantagedrives operate much more slowly than system RAM. This is not a trivial difference. RAM is six orders of magnitude (not 6, but 106) faster than a hard drive. As a consequence, hard-drive performance has
1443
1444
become a limiting factor in todays PCs. Making the hard drive faster and more efficient is now an important part of system optimization. This chapter is intended to help you understand the factors that influence drive performance and provide a series of guidelines to maximize that performance.
SEEK TIME
Because read/write heads are mechanical devices, a finite amount of time is required to move them across a disk platter. The amount of time required to accomplish this move depends on several things: the size of the drive and the type of mechanism moving the heads. Newer drives are typically quite small, so the distances that must be traversed are short. Smooth and efficient voice-coil actuators are the head-drive mechanism of choice, so movement is also enhanced. The combination of these factors have drastically reduced seek time over the last 15 years, but seek time is still a major part of overall drive delays. Unfortunately, seek time is a rather generic termdifferent manufacturers each measure seek time as a slightly different parameter. The best-case seek time is referred to as trackto-track seek time, where the R/W heads only need to step in or out to the next adjacent track (or cylinder). This time is typically only a few hundred microseconds. If the best-case seek time is the time required to step between two adjacent tracks, the worst-case seek time is the time needed to step from the outermost track to the innermost track (or vice versa). Few manufacturers actually use this time because it seems so large. Instead, most drive manufacturers use an average seek time, which is the time needed to step halfway across the disk surface. Today, most drives offer average seek times between 8 ms and 15 ms.
DATA-TRANSFER RATE
Once the R/W heads have moved into position (during the seek time), data can flow to or from the drive. The rate at which data can flow is known as the data-transfer rate. Data transfer is generally given in Mbits/second. If you divide this figure by eight, you will get MB/second. A more practical measure of data transfer is the data rate between the hard drive and the drive controller (across the interface). EIDE hard drives can support burst data-transfer rates up to 16MB/s, although Ultra-ATA hard drives can reach 33MB/s. This is comparable with fast SCSI-2 drive configurations (Table 54-1). Data-transfer rates are a key part of drive delaymost of the hesitation and pauses you see in the everyday operation of DOS or Windows 95 is largely because the operating system is waiting for the drive to catch up. The operating system typically must wait for a file to be loaded or saved before any other operations can continue. The faster a files data can be transferred to or from the drive, the shorter those delays would be.
1445
TABLE 54-1 COMPARISON OF HARD DRIVE DATA TRANSFER RATES DATA-TRANSFER MODE Single Word DMA 0 PIO Mode 0 Single Word DMA 1 Multi Word DMA 0 SCSI-1 PIO Mode 1 PIO Mode 2 Single Word DMA 2 Fast SCSI-2 Wide SCSI-2 PIO Mode 3 Multi Word DMA 1 PIO Mode 4 Multi Word DMA 2 Fast/Wide SCSI-2 Fast-20 SCSI-3 Multi Word DMA 3 Wide/Fast-20 SCSI-3 Fast-40 SCSI-3 Wide/Fast-40 SCSI-3 BURST DATA RATE 2.1MB/s 3.3MB/s 4.2MB/s 4.2MB/s 5.0MB/s 5.2MB/s 8.3MB/s 8.3MB/s 10.0MB/s 10.0MB/s 11.1MB/s 13.3MB/s 16.6MB/s 16.6MB/s 20.0MB/s 20.0MB/s 33.0MB/s 40.0MB/s 40.0MB/s 80.0MB/s NOTES Old ATA (IDE) drives IDE drives IDE drives IDE drives 8-bit SCSI IDE drives IDE drives IDE drives 16-bit SCSI 16-bit SCSI Newer ATA-2 (EIDE) drives EIDE drives EIDE drives EIDE drives 16-bit SCSI 8-bit SCSI Ultra-ATA (Ultra-DMA/33) drives 16-bit SCSI 8-bit SCSI 16-bit SCSI
FILE FRAGMENTATION
The interaction of operating systems also affects drive performance. When a drive is highlevel formatted with an operating system, the drives space is segregated into sets of adjacent sectors (called clusters). The size of a cluster depends on the size of the drive, but todays large, multi-gigabyte drives usually use 32KB to 64KB clusters. The cluster approach was designed to simplify file housekeepingeasing file storage-tracking requirements while keeping wasted space acceptable. Although the system is less than ideal, it works, and has been in use since DOS was able to support hard drives. The problem with cluster-based file storage is that files are stored wherever clusters are available. Ideally, all of the clusters that compose a file should be contiguous, but that is a rare occurrence. As a drive fills and old files are erased, clusters are filled and reclaimed throughout the drive. As a result, changing files gradually become scattered across the drive as DOS searches frantically for any available clusters. This scattering behavior is called file fragmentation and it is a natural side-effect of DOS. The problem with file fragmentation is that each time the continuity of a file is broken, the R/W heads have to be repositioned before another cluster can be read. If a file uses four clusters, and each cluster is several tracks apart, the heads will have to be repositioned four times to read or write that file. These additional seek times all add together to prolong the loading or saving of a file. In addition to these delays, the extra mechanical demands of R/W head positioning can eventually lead to premature drive failure.
3
SYSTEM MAINTENANCE AND SUPPORT
1446
The drive/interface technology relates to the way in which data is encoded to and decoded from the drive. Some of the original drive technologies used MFM and RLL recording techniques. They were effective, but they limited data transfer. As drives became more sophisticated, improved encoding techniques not only helped to increase the drives density, but supported faster data transfer as well. SCSI and IDE/EIDE/Ultra-ATA interfaces use some of the most efficient encoding available. Circuit design is a more indirect variable, affecting adapter performance. Todays highly integrated controllers are able to process and transfer data far faster then older controller circuits. When combined with other hardware techniques, such as drive caching, performance can be fundamentally enhanced at the hardware level. Ultimately, the drives underlying technology will affect data transfer.
DRIVE INTERLEAVE
In the early days of PCs, drive data could be delivered at a much higher rate than the interface and system CPU were capable of handling. This presented a problem for early drive designershow you slow down a drive spinning at 3200 RPM so that the CPU can keep pace? Drive designers answered this question by introducing the idea of interleave. By staggering the order of each sector around a track, the drive is forced to make several complete rotations in order to read all sectors. Although the drive rotates at the same speed, larger amounts of interleave affect the drives apparent speed larger interleaves slow the drive (and vice versa). A 3:1 interleave is typical of XTstyle MFM drives. The disk has to rotate three times in order to read all 17 sectors. A 2:1 interleave is more efficient, and is often found in older AT MFM and RLL drives. Two complete rotations are needed to read all 17 sectors. The most efficient interleave is 1:1 (effectively no interleave), where all of the sectors are in order around the track. An entire track can be read in one rotation. As a general rule, the larger the interleave, the slower the drive. Today, virtually all hard drives use a 1:1 interleave for optimum performance.
1447
Under no circumstances should you ever use any utility to alter the drive interleave from an optimum value of 1:1. This will severely reduce drive performance.
3
SYSTEM MAINTENANCE AND SUPPORT
1448
If you find yourself low-level formatting a hard drive, be careful to avoid a less-efficient interleave factoreven if it is provided as a recommended default. A drive thats working properly at a 1:1 interleave will not work any better at a different interleave. For older drives that use a larger interleave, however, it might be possible to reset the interleave when the drive is low-level formatted. Most PCs since 1986 have been fast enough to tolerate a 1:1 interleave, given a fairly recent controller. If you encounter an ST506/412 or an ESDI drive system with an interleave of 2:1 or 3:1 (or more), try altering the interleave during a low-level format. An old drive controller might not tolerate a lower interleave.
1449
USE BUFFERS
DOS provides a primitive form of caching through the use of RAM buffers. Buffers are allocated through the BUFFERS= command in your CONFIG.SYS file. Each buffer sets aside 528 bytes of RAM: 512 bytes to hold a sectors worth of disk information and 16 bytes for overhead data. The memory required for each buffer is drawn from conventional memory. So, the number of buffers set aside for drive use is often a tradeoff of conventional memory for performance. As a minimum, 20 buffers should be set aside for a hard drive (although 30 to 40 buffers is more common in todays systems). Depending on the speed of your system, you should be able to adjust the number of buffers for optimum drive performance. Remember that you must reboot the system each time a change is made to the CONFIG.SYS file.
The use of buffers is only important under DOS. If you work exclusively under Windows 95, chances are that assigning buffers will have no significant impact on drive performance. Youd be better-off leaving the buffers= statement out and saving the conventional memory.
USE CACHING
The premise of disk caching is fundamentally the same as memory cachingwhen the disk is read into memory, extra (or anticipated) information is read into cache memory as well. This is known as read caching. Because RAM can be read much faster than the disk, the effective disk speed is greatly improved because the needed information is already in memory. Another caching technique stores file data in memory until there is an idle moment for the system to copy the file to disk. Once again, the speed of RAM allows the file to appear written almost immediately (known as write caching). Generally, two forms of caching are used with disk drives: hardware and software. Hardware caching uses a limited amount of RAM implemented on the hard drive or hard drive controller (perhaps both) under the control of drive BIOS. Software caching uses a utility (such as SmartDrive under DOS) to allocate and manage a portion of system RAM as the disk cache. The advantage of software caching is that many different drives are supported (e.g., floppy drives and CD-ROM drives). On the negative side, software caching requires conventional or upper memory for the utility itself, as well as extra RAM for the cache. If you are able to activate caching, it is almost always worthwhile.
Windows 95 incorporates its own unique disk-caching algorithms. When working under Windows 95, you do not need any DOS-based or supplemental disk-caching utility. If you have been running disk-caching utilities, such as SmartDrive, it should be disabled when using Windows 95.
3
SYSTEM MAINTENANCE AND SUPPORT
1450
from a compressed state requires more time during drive operationstheres no way around it. If you are already faced with a compressed drive, it is possible to uncompress the drive if you need to squeeze out every last element of performance (but it is often more work than it is worth). If you are contemplating adding compression, consider the tradeoff between speed and performance first.
FIGURE 54-1
1451
FIGURE 54-2
needed. Normally, you do not need to tinker with virtual memory (just leave it on automatic). Once Windows is running, select Start, Settings, Control panel, then click on the System icon. Select the Performance tab, then click on the Virtual memory button. This brings up the Virtual memory dialog (Fig. 54-2). Normally, most of the dialog is grayedout and Windows 95 runs the swap file automatically. However, you can select to set your own swap file settings. If you select that option, you can also set the check box to disable virtual memory.
The ultimate means of virtual memory improvement would be to minimize the need for a swap file by adding more RAM to the system (usually more than 32 to 64MB of RAM).
3
SYSTEM MAINTENANCE AND SUPPORT
1452
FIGURE 54-3
pull-down menu is set for your drive speed. In virtually all cases, the entry should be Quad speed or higher.
Further Study
Thats all for Chapter 54. Be sure to review the glossary and chapter questions on the accompanying CD. If you have access to the Internet, take a look at some of these hard-drive resources: Maxtor: http://www.maxtor.com Microsoft: http://www.microsoft.com Quantum: http://www.quantum.com Seagate: http://www.seagate.com Western Digital: http://www.wdc.com (SmartDrive and DriveSpace 3)