Defragmentation and Windows NT Performance Benefits
Introduction
A series of tests was conducted to determine, in a laboratory environment, the potential for performance improvement with defragmentation of the Windows NT File System (NTFS). This is the results of those tests.
Definitions of Terms
fragmentation - "the state of being fragmented." The word fragment means "a detached, isolated or incomplete part." It is derived from the Latin fragmentum, which in turn is derived from frangere, meaning "break." So fragmentation means that something is broken into parts that are detached, isolated or incomplete.
file fragmentation - computer disk files that are not whole but rather are broken into scattered parts.
free space fragmentation - the empty space on a disk is broken into scattered parts rather than being collected all in one big empty space.
Note: For the purpose of these tests, the term disk fragmentation includes both file fragmentation and fragmentation of the free space on the disk.
Background on the NTFS File System
The Windows NT File System (NTFS) was created specifically for use with the Windows NT Operating System. NTFS is a recoverable, secure, reliable and efficient file system which supports client-server systems.
NTFS keeps track of the contents of a volume in a file called the Master File Table (MFT). The MFT consists of an array of file records, with each file usually represented in the MFT by one file record. If, however, a file has a large number of file attributes (such as security information), or becomes highly fragmented, more than one file record may be needed.
As more files and file records are added to a volume, the MFT may need to expand to accommodate more file records. As the MFT expands, it may also fragment across the disk. Once the MFT expands it will not shrink, but unused file records become available for re-use as files are deleted and created.
Test Configurations
These tests were performed on two separate computer systems, representative of a midrange system and a higher-end system.
- Dual Pentium 90MHz running Windows NT Workstation Version 4.0, an Adaptec 2940 PCI adapter, and a Seagate Hawk SCSI-2, 4.0 Gigabyte drive formatted into six, 500 Megabyte NTFS partitions (the remaining 1 gigabyte of space on the disk was not used).
- Pentium Pro 200MHz running Windows NT Workstation Version 4.0, a BusLogic Flashpoint PCI adapter, and the same Seagate Hawk SCSI-2, 4.0 Gigabyte drive, again formatted into six, 500 Megabyte NTFS partitions.
Procedures Used for Testing
In each test, the volumes used in testing were initially formatted NTFS. They were not converted from FAT to NTFS. Half the partitions were formatted under Windows NT 3.51 and half were formatted under Windows NT 4.0. All the tests were run under Windows NT 4.0.
A standardized procedure was used to produce a specific level of file fragmentation on each volume tested:
-
The entire volume was filled with files of uniform length, 2000 files per directory. Every other file was deleted,
thus uniformly fragmenting the free space on the volume.
Having the free space uniformly fragmented at a known level is desirable for the write tests so that each time a file is written to the volume it is guaranteed the file will be written at a known level of fragmentation.
The uniform-length files vary in size depending on the desired level of average fragments per file: 4096 byte files for 6.2 average fragments per file (11.11 on Windows NT 3.51), 8192 byte files for 3.51 average fragments per file (6.41 on Windows NT 3.51), and 32768 byte files for 1.61 average fragments per file (2.20 on Windows NT 3.51).
- Next, the Windows NT Workstation 4.0 CD-ROM was copied to the volume. Multiple directories were created and the CD-ROM was copied into each directory until the volume was full. This group of files was chosen for its variety of file types and sizes.
- The rest of the original uniform-length files were then deleted. At this point both the Windows NT files and the free space were uniformly fragmented.
The fragmentation analysis function of Diskeeper Lite was used to analyze and determine the level of fragmentation on each volume. Average Fragments per File is an index of the level of file fragmentation on the disk. If the average fragments per file is 1.00, the files are contiguous. 1.10 means 10% of the files, on average, are in two pieces, etc.
Once each volume was set up and verified, the benchmark test program, NTBENCH.EXE, was run to measure individual file reads/writes, and entire disk read/write passes (cached reads and writes were not performed).
The performance tests were:
- Measurement of the degree of fragmentation of files on the volume, using the fragmentation analysis function of Diskeeper Lite.
- One pass of locating and reading every file on the volume using NTBENCH.EXE.
- One pass of locating and making a temporary copy of every file on the volume using NTBENCH.EXE (excluding deletion time of the temporary file).
This series of tests was run on the partitions formatted under Windows NT 3.51 as well as those formatted under Windows NT 4.0. Appendix A shows the test results on the Dual 90 MHz Pentium system, and Appendix B shows the results on the Pentium Pro 200 MHz system.
Conclusions
As can be seen in all the tests, defragmentation of files and free space significantly restores system performance. In fact, defragmenting the volume almost completely restores disk performance to pre-fragmentation levels.
Comparison of the defragmented volume to the control volume also points up the importance of regular defragmentation. In the testing above, the time to read and write files did not fully return to pre-fragmentation levels. This is due to Master File Table fragmentation. Since the MFT does not shrink after expansion, regular defragmentation from initialization helps ensure the MFT does not grow disproportionately.
Overall, these tests indicate that fragmentation is a major factor in the performance of a Windows NT system. Defragmentation of an NTFS volume, especially one which has been in use for some length of time, can be expected to substantially improve responsiveness.
Appendix A
Dual Pentium 90 MHz -- Windows NT 4.0-Formatted Volumes
| Number of minutes to Read Every File on the Disk | |||||
|---|---|---|---|---|---|
| Average Fragments per File | Control | 1.00 | 1.61 | 3.51 | 6.20 |
| Disk Read (minutes) | 4.04 | 4.65 | 6.85 | 7.01 | 8.06 |
| % of ideal | 100.00 | 115.10 | 169.55 | 173.51 | 199.50 |
Dual Pentium 90 MHz -- Windows NT 3.51-Formatted Volumes
| Number of minutes to Read Every File on the Disk | |||||
|---|---|---|---|---|---|
| Average Fragments per File | Control | 1.00 | 2.20 | 6.14 | 11.11 |
| Disk Read (minutes) | 4.25 | 4.68 | 7.65 | 6.97 | 6.42 |
| % of ideal | 100.00 | 110.12 | 180.00 | 164.00 | 151.06 |
Dual Pentium 90 MHz -- Windows NT 4.0-Formatted Volumes
| Number of minutes to Read then Write Every File on the Disk | |||||
|---|---|---|---|---|---|
| Average Fragments per File | Control | 1.00 | 1.61 | 3.51 | 6.20 |
| Disk Read / Write (minutes) | 13.71 | 17.05 | 20.27 | 20.46 | 22.13 |
| % of ideal | 100.00 | 124.36 | 147.85 | 149.23 | 161.42 |
Dual Pentium 90 MHz -- Windows NT 3.51-Formatted Volumes
| Number of minutes to Read then Write Every File on the Disk | |||||
|---|---|---|---|---|---|
| Average Fragments per File | Control | 1.00 | 2.20 | 6.14 | 11.11 |
| Disk Read / Write (minutes) | 14.57 | 16.02 | 22.66 | 23.80 | 27.16 |
| % of ideal | 100.00 | 109.95 | 155.53 | 163.35 | 186.41 |
Appendix B
Pentium Pro 200 MHz -- Windows NT 4.0-Formatted Volumes
| Number of minutes to Read Every File on the Disk | |||||
|---|---|---|---|---|---|
| Average Fragments per File | Control | 1.00 | 1.61 | 3.51 | 6.20 |
| Disk Read (minutes) | 2.07 | 2.41 | 4.13 | 4.81 | 5.79 |
| % of ideal | 100.00 | 116.43 | 199.52 | 232.37 | 279.71 |
Pentium Pro 200 MHz -- Windows NT 3.51-Formatted Volumes
| Number of minutes to Read Every File on the Disk | |||||
|---|---|---|---|---|---|
| Average Fragments per File | Control | 1.00 | 2.20 | 6.14 | 11.11 |
| Disk Read (minutes) | 2.38 | 2.31 | 4.87 | 4.88 | 4.66 |
| % of ideal | 100.00 | 97.06 | 204.62 | 205.04 | 195.80 |
Pentium Pro 200 MHz -- Windows NT 4.0-Formatted Volumes
| Number of minutes to Read then Write Every File on the Disk | |||||
|---|---|---|---|---|---|
| Average Fragments per File | Control | 1.00 | 1.61 | 3.51 | 6.20 |
| Disk Read / Write (minutes) | 10.43 | 12.45 | 15.49 | 16.41 | 16.96 |
| % of ideal | 100.00 | 119.37 | 148.51 | 157.33 | 162.61 |
Pentium Pro 200 MHz -- Windows NT 3.51-Formatted Volumes
| Number of minutes to Read then Write Every File on the Disk | |||||
|---|---|---|---|---|---|
| Average Fragments per File | Control | 1.00 | 2.20 | 6.14 | 11.11 |
| Disk Read / Write (minutes) | 11.25 | 12.71 | 17.76 | 18.87 | 20.49 |
| % of ideal | 100.00 | 112.98 | 157.87 | 167.73 | 182.13 |