Anda di halaman 1dari 10

54

ENHANCING DRIVE PERFORMANCE

CONTENTS AT A GLANCE Drive Performance Factors


Seek time Data-transfer rate File fragmentation The drive adapter Drive interleave

Software Drive Enhancements


Keep the drive defragmented Use buffers Use caching Eliminate drive compression Adjust the file system Adjust the virtual memory Optimize the CD-ROM cache

Hardware Drive Enhancements


Manage the interleave Manage the bad sectors Upgrade the drive hardware

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

ENHANCING DRIVE PERFORMANCE

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.

Drive Performance Factors


To improve the performance of a hard drive, you must first understand the factors that influence drive performance. The two most important factors are time-related: the amount of time it takes to locate a file and the rate at which data can be passed back and forth between the drive and systemevery other concern is intimately related to those two criteria.

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.

DRIVE PERFORMANCE FACTORS

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

ENHANCING DRIVE PERFORMANCE

THE DRIVE ADAPTER


Where the process of R/W head seek is a function of the drives internal construction, data transfer is largely a function of the drives controller circuitry (or drive adapter). Three factors influence the data rate: the width of the data path, the technology of the drive, and the overall construction of the drive-adapter circuit itself. The data path width is the number of bits that travel simultaneously between the drive controller and the PC. Older XTtype controllers used an 8-bit data width. Most traditional ISA-based systems use 16-bit controllers. IDE and SCSI drives typically use 16-bit drive controllers (a 16-bit controller can carry twice as much data at any one moment in time than an 8-bit controller). With the broad adoption of 32-bit PCI-bus drive adapters, the wider data path allows even higher data throughput between the system and drive controller.
The data path refers to the width of the expansion bus, which the drive controller is plugged intonot the width of the data path between the drive and drive controller.

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.

HARDWARE DRIVE ENHANCEMENTS

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.

Hardware Drive Enhancements


Although shaving a few milliseconds from a drives performance might seem unnecessary, streamlining the drive hardware can have some substantial advantagesmost noticeably a reduction in hesitation when files are loaded or saved. Fewer drive errors and greater overall reliability are other advantages worth considering. This part of the chapter outlines some recommendations for improving drive performance through hardware.
To gauge the effectiveness of any changes or enhancements made to the hard-drive system, be sure to run a benchmark program to measure the drive systems performance both before and after your adjustment. This allows you to make a quantitative evaluation of the improvement. CHECK THE DRIVE CONNECTIONS The integrity of electrical cables and contacts play a surprisingly vital role in drive performance. It is not unusual for errors to creep into data transferred between the drive and system. In many cases, the error-correction techniques used with hard drives will successfully compensate for such problems, but the recovery process demands extra time as the system tries to read or write the erroneous data again. By improving the quality of signal connections, data errors can be reducedresulting in slightly faster drive performance. As a general rule, start with the data cable(s) between the drive and its adapter board. Be sure to remove all power from the PC and disconnect the ac cable from the wall outlet. Be sure that the cables are installed properly and completely. Loose connectors can easily result in intermittent data problems. It is natural for a layer of oxide to cover the contact metals in each connector. However, oxides act as an insulator, raising the resistance of a connection and increasing the probability of data errors. Try removing each connector (one at a time) and re-insert it carefullythis will help to wipe away any oxides. Also inspect each data cable for damage, such as cuts, wear, or abrasions in the cable insulation. If you find a worn or damaged cable, try replacing it. The overall length of data cables also affects signal integritylonger cables allow for greater data errors. If you find an unusually long cable, try replacing it with a shorter one. For example, you might only have one hard drive in the system, but the data cable might be fitted for a dual-drive installation. Next, check the drive adapter. Be sure that it is installed properly and completely in its expansion slot. Remove the drive adapter and re-insert it in its expansion slot. This will scrape off any buildup of oxidization on the adapters card edge fingers. If the adapter board seems loose in its expansion slot, try moving the board to a new slot.

3
SYSTEM MAINTENANCE AND SUPPORT

MANAGE THE INTERLEAVE


Most of the contemporary hard drives in service today (EIDE/Ultra-ATA and SCSI) use an interleave of 1:1 to allow for the fastest possible transfer of data off the drive platters.

1448

ENHANCING DRIVE PERFORMANCE

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.

MANAGE THE BAD SECTORS


Another function of low-level formatting is to identify and mark bad sectors and tracks to prevent their being used by DOS. If the low-level format utility for your particular drive offers the ability to find bad areas (sometimes called a surface scan or media-analysis option), you can locate and lock out any bad drive areas that might have failed since the drive left the factory. Reducing the number of bad sectors available to DOS will help to prevent file errors.

UPGRADE THE DRIVE HARDWARE


The points covered previously are largely issues of drive maintenance. Although they all contribute to faster and more reliable drive performance, few tactics improve drive performance as much as a new drive system. As seek times fall, transfer rates climb, and reliability continues to improve, a new hard drive and drive adapter might be an appropriate and timely solution to a slow, old drive. In some cases, a new drive adapter alone might be enough to enhance an existing drive, but because IDE/EIDE/Ultra-ATA and SCSI drives contain the vast majority of their controlling circuitry right on board the drive itself, you will most likely be replacing the drive and adapter card.

Software Drive Enhancements


Although hardware upgrades provide some impressive improvements, system software has come to play an important role in drive performance as well. Disk caching and compression techniques are constantly attempting to push the limits of PC processing capabilities. This part of the chapter covers a variety of software tactics to enhance drive operations.

KEEP THE DRIVE DEFRAGMENTED


As you saw earlier in this chapter, file fragmentation can slow down a drives performance by forcing excessive R/W head positioning as the drive searches for related clusters of a file. This can cause particular problems for disk-intensive environments, such as Windows 95especially the Windows 95 swap file used to provide virtual memory. A defragmenter (such as Windows 95s Defrag) is a disk utility which rearranges files to make each related cluster contiguous. By defragmenting the drive regularly, you can avoid the delays of excessive head positioning and keep the drive running smoothly.

SOFTWARE DRIVE ENHANCEMENTS

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

ELIMINATE DRIVE COMPRESSION


Drive compressors, such as DriveSpace 3, have proven to be very effective and reliable tools for extending limited drive capacity. Unfortunately, the translation of data to and

1450

ENHANCING DRIVE PERFORMANCE

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.

ADJUST THE FILE SYSTEM


You can adjust the disk caching under Windows 95. Once Windows 95 is running, select Start, Settings, Control panel, then click on the System icon. Select the Performance tab, then click on the File system button. This brings up the File system properties dialog (Fig. 54-1). There are two entries: a pull-down menu specifying the role of the machine and a slider that adjusts your drive caching (read-ahead optimization). Be sure that the entry in your pull-down menu accurately reflects the use of your PC (almost always a desktop). The caching slider is probably set to the maximum value. If not, try increasing the readahead optimization and see if you pick up any performance improvements there.

ADJUST THE VIRTUAL MEMORY


Virtual memory is the use of drive space to simulate the role of RAM. More specifically, segments of RAM are swapped onto and off your hard drive. This allows you to run applications that would otherwise require more physical RAM than you have in your system. However, the regular swapping of data to and from the drive does slow the system. Ideally, you would like to set the virtual memory to a size that is large enough to be useful, but small enough to minimize swapping. One of the improvements to Windows 95 is that not only will it determine the optimum swap file size, but that the swap file size is dynamicit can be grown or shrunk as

FIGURE 54-1

The File system properties dialog under Windows 95.

SOFTWARE DRIVE ENHANCEMENTS

1451

FIGURE 54-2

The Virtual memory dialog under Windows 95.

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).

OPTIMIZE THE CD-ROM CACHE


The CD-ROM drive is far slower than the hard drive. Fortunately, it is accessed far less than a hard drive. Even so, when a CD-ROM is used, its slow data-transfer time can be a problem. Windows 95 helps to compensate for this by supporting built-in CD-ROM drive caching (caching with older utilities, such as SmartDrive, are eliminated). It is possible to optimize the CD-ROM caching for best performance. Once Windows is running, select Start, Settings, Control panel, then click on the System icon. Select the Performance tab, then click on the File system button. This brings up the File system properties dialog. Select the CD-ROM tab (Fig. 54-3). The two entries are: a slider controlling the amount of supplemental cache provided for the CD-ROM drive and a pull-down menu that allows you to optimize the CD-ROM access. If the supplemental cache slider is not at its maximum level, go ahead and increase its value. You might not see any direct improvement until the CD-ROM is accessed. Be sure that the entry in your

3
SYSTEM MAINTENANCE AND SUPPORT

1452

ENHANCING DRIVE PERFORMANCE

FIGURE 54-3

Adjusting the CD-ROM cache under

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)

Anda mungkin juga menyukai