Don't let your disks go to pieces
Recently, I began researching defragmentation for a worldwide deployment of 34 Windows NT servers. Having spent a decade with Digital's VMS operating system (OS), I'm familiar with the performance problems associated with fragmented disks. I remember one case in which logon time decreased from 75 seconds to less than 10 seconds after I defragmented several VMS disks that had not been maintained for 2 to 3 years. Fortunately, maximizing disk performance with NT is an achievable goal.
In the US, the UK, France, and Germany, my company deployed HP NetServers configured with standard RAID hardware. Because my company will manage these remote systems from Denver, Colorado, reliability and redundancy are critical. The servers have two disk configurations of four to six 4GB-to-9GB hard disks. The high-end configuration uses RAID 1 (mirroring) for the system disk and RAID 5 (stripe sets with parity) for the remaining disks. The low-end configuration consists of four disks in a RAID 5 set. As I worked on the NT configuration details, one question kept resurfacing: Does defragmenting a RAID set make sense? Because many users believe RAID hardware doesn't require defragmentation, I decided to research the subject.
What Is Disk Fragmentation?
Executive Software, the company that makes Diskeeper 3.0 for Windows NT Server (the software defragmentation tool I used in my research), defines disk fragmentation as a condition in which pieces of individual files on a partition are noncontiguous, or scattered around the partition, and the free space on a partition is in many small pieces rather than a few large ones. Under ideal circumstances, a file system physically stores a file in a contiguous section of the disk. Finding contiguous space for a file is easy when a disk is new and contains only a few files. However, as you delete and add files over time and the amount of free space declines, the number of large blocks of contiguous free space also declines. The file system must write a file in multiple segments across different portions of the disk. The file system manages these fragments, so they are transparent to applications and end users.
Fragmentation tends to increase when the file is less than 20MB and the number of deletions is high in proportion to the number of writes. Database files are especially susceptible to fragmentation. If your database has an automatic compaction utility, you should schedule it to run at regular intervals.
Retrieving a file stored in a contiguous section requires only one seek operation and at least one transfer. Retrieving a fragmented file requires multiple seeks and transfers. The performance cost is in the seek time associated with each segment. When the Master File Table (MFT) fragments, the file system must perform multiple seeks and reads just to locate the file and its starting block number. Directory fragmentation has an even worse effect on I/O performance, and the combination of directory and data-file fragmentation can make a high-performance disk subsystem operate at a snail's pace.
RAID 1 maintains a full online copy of the system disk. Every write to the system disk is duplicated on the mirror disk. If the primary disk fails, you can access the OS on the mirror disk. RAID 1 can provide up to 70 percent performance improvement for read operations because the read can occur on either the original or the mirrored disk. However, writes are less efficient because they must be done on both disks. Typically, a system disk is read far more often than it is written, especially if the pagefile is on another disk, so mirroring a system disk can be a highly effective performance technique.
The goal of a striped disk array is to spread one file across multiple disks so that you can access the entire file in one read operation. RAID 5 adds parity information to each disk; in the event of a disk failure, you can reconstruct the missing disk from parity information on the adjacent disks.
Example of Performance Degradation
Suppose you want to read a 40MB file that's written contiguously on one disk. Searching and transferring the file takes 1000 milliseconds (ms): The seek operation takes 9ms, and the transfer takes 991ms. However, if you store this 40MB file on a four-disk stripe set, each disk stores 10MB (or a quarter) of the data. Therefore, the same read operation will take 9ms to seek and 250ms to transfer because the system performs the I/O with each disk concurrently.
Let's assess the effect of fragmentation in this 40MB file. If it takes 9ms to seek and 991ms to read the contiguous file, the overhead is 9 ÷ 1000 or less than 1 percent. If this same file has 10 fragments, the overhead is 90 ÷ 1000 or 9 percent. If you apply the same overhead to the stripe-set situation, the degradations are 3.6 percent (9 ÷ 250) and 36 percent (90 ÷ 250), respectively. Fragmentation on standalone disks or RAID sets always introduces disk performance problems.