Subscribe to Windows IT Pro
July 01, 1998 12:00 AM

Tech Stories from the Trenches

Windows IT Pro
InstantDoc ID #3583
Rating: (0)
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.

Diskeeper Server 3.0
Contact: Executive Software 800-829-6468
Web: http://www.diskeeper.com

Related Content:

ARTICLE TOOLS

Comments
  • Jeff Noguera
    13 years ago
    Aug 11, 1999

    I read Paula Sharick’s “Tech Stories from the Trenches” (July) about disk fragmentation and the Diskeeper defragmentation product that NT 5.0 will include. I’m using Diskeeper, and it doesn’t seem to be doing as well as most people proclaim. I’m disappointed in its performance. I’ve used Norton on other systems, and I expected Diskeeper to do a full defrag on the first pass, much as Norton does. I’ve not run Norton on an NT system, so I don’t have a valid comparison between the two products with respect to NT. Can you shed some light on how I can maximize Diskeeper’s performance?

    --Jeff Noguera



    Files can remain fragmented after you’ve run Diskeeper. Here are six reasons (according to Executive Software) why files might remain fragmented:


    1. Not enough contiguous free space exists on the drive for a copy of the file that needs defragmenting. Executive Software recommends 20 percent to 25 percent free space on the disk. However, even if you have that much available disk space, it may not be contiguous, and you may need more free space. (Diskeeper cannot use the Master File Table–MFT–reserved area on NTFS volumes as free space for defragmentation purposes.)

    2. The file (or directory or partition) doesn’t grant system and administrator write access. Without these permissions, Diskeeper cannot open a file that needs defragmenting, so it cannot defragment the file.

    3. An application (such as SQL Server) or a program running in the background (such as a service) might be holding a file open, thus preventing defragmentation. For example, NT holds the NTFS log files open, and they cannot be defragmented online.

    4. Diskeeper cannot move some parts of the partition (e.g., the MFT and other system files, the paging files, and the directory files). Fragments of these files can prevent Diskeeper from doing its job on a disk because the software cannot move these fragments out of the way. (Diskeeper 3.0 has a boot-time directory defragmenter to help alleviate this problem.)

    5. Some pieces of the MFT are external to the MFT. Unfortunately, Diskeeper cannot move these MFT pieces, which show on the display in blue (eligible for defragmentation) rather than green (not eligible for defragmentation). Frequently, such fragments happen as the result of compressing large data files. Decompressing these large data files will not make the extra MFT pieces go away. Only making a copy of the file, deleting the original, and copying the file back will make them go away.

    6. An impasse of some sort exists. For example, a partition that starts out with badly fragmented MFT, directories, and pagefile is usually beyond the kind of improvements Diskeeper can make. The best thing to do is to back up the partition, reformat, and restore. Sometimes, the source of the problem is one or two files—the partition could store a file contiguously if it weren’t already in the same space in multiple fragments. In this case, the best thing to do is copy the file off the partition, let the defragmenter do its job, and copy the file back. This problem is typical on NTFS partitions.



    If you try either solution 5 or 6, be careful not to do it with compressed files. Compressed files tend to self-fragment because of the way NTFS file compression works. Self-fragmentation can happen whether you’re using Copy or Backup/Restore. Decompress the files first.

    --Paula Sharick

  • Hugh McLaren
    13 years ago
    Aug 11, 1999

    Thanks for Paula Sharick’s “Tech Stories from the Trenches” (July) about the importance of defragmenting Windows NT servers. I never thought that defragmenting NT systems, particularly RAID systems, was that significant. I’ll give it a go on my company’s server when I can schedule off time.
    In the article, the author challenges, “I bet you can’t top my 13,768 fragment total on the disk I ignored for a year!” I had 14,200 after I’d started the defrag process and deleted the highly fragmented pagefile.sys. I estimate I must have been in the 17,000s.

    --Hugh McLaren

  • Kenneth Kemp
    13 years ago
    Aug 06, 1999

    I recently came across Paula Sharick’s article about disk defragmentation, “Tech Stories from the Trenches” (July 1998). After reading the author’s war story about improved logon times, I had to share my favorite tale.
    I used to work for a subsidiary of Pennzoil that used a VAX 750 for applications ranging from process monitoring to map plotting to word processing. Shortly after I went to work there, one of the users informed me that he couldn’t create a new directory because there wasn’t enough disk space. Knowing a shortage of disk space couldn’t be the case, I had him demonstrate the problem. Sure enough, that was the message he received. I checked the disk and found it had more than 23,000 free blocks.
    I called Digital Equipment to see whether its tech support could tell me what was causing the problem. The tech support representative informed me that to create a directory, the disk had to have a minimum of 3 free blocks. I told him the disk had more than 23,000 free blocks. He said that he meant the disk needed 3 contiguous blocks to create the directory. I said, “Wait a minute. You’re telling me that I have 23,000 free blocks, and no 3 are contiguous?” He answered, “That’s what I’m saying.”
    So I backed up the disk and then restored it. Guess what? He was right! Now that’s fragmentation! When I approached the person who had managed the system before I came, he said, “What’s fragmentation?” As in the magazine story, the system had been in place for a couple of years and had never been defragmented. Needless to say, we ordered a copy of Diskeeper as soon as we could.

    --Kenneth Kemp

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.