It is a well-known fact that file system fragmentation degrades the performance of your disk and, on top of that, Windows takes a long time to start on many systems. Both problems have to do with the way file systems operate. But why is that? And how does DiskSpeeder solve those problems?
NTFS is the preferred file system for Windows. NTFS supersedes the FAT file system. Both file systems store file data in small units called clusters. Large files may occupy thousands of clusters. The ideal situation is to have the clusters of each file stored contiguously on the disk. This allows for rapid sequential file reads and writes. If each cluster of a file is placed right after the previous cluster, then the entire file can be read in a single progressing operation. On the contrary, if the clusters are scattered around the disk, then the read operation must divided into several smaller chunks of disk reads, which will slow down the read significantly. This is called file system fragmentation. Fragmentation is bound to happen as files are added, removed, and changed in size, because the free space becomes fragmented, leaving only small holes in which to place new data.
Many Windows systems take a very long time to start. The reason for this is actually somewhat related to file system fragmentation. The primary bottleneck during Windows boot is the file system. As the startup progresses more and more processes are created that simultaneously read from the disk. The file system will attempt to satisfy all read requests by dividing them into several smaller read operations. Consequently, the disk reads will be scattered around the disk. Just like when reading from a fragmented file.
Warp Disk Software addresses both these problems with DiskSpeeder. No other single software solution does that.
Traditionally, defragmentation software are user applications or services that either run on demand or at certain intervals. DiskSpeeder takes a brand new approach. Ideally, the file system should take care of keeping its files defragmented. This is not the case today; at least not with the NTFS file system. DiskSpeeder effectively extents the NTFS file system with fragmentation prevention capabilities and read-ahead boot caching. Figure 1 depicts how this is done. The figure is a simplified view of the file system architecture with DiskSpeeder installed. When a user application reads or writes on the disk the request passes through layers of drivers that send I/O requests to each other. The figure shows how DiskSpeeder encapsulates the NTFS file system driver. The Defragmentation Driver above takes care of fragmentation prevention. The Boot Cache Driver below does the read-ahead caching during Windows boot.
Figure 1 - File system architecture with DiskSpeeder installed. The blue boxes are the DiskSpeeder components.
Figure 1 also depicts the two contexts that software runs in: user mode (green) and kernel mode (red).
User applications executes in user mode, while operating system code (such as system services and drivers) executes in kernel mode. User mode refers to an execution state in the CPU in which individual processes cannot access memory or program code in other processes and do not have access to all CPU instructions. Kernel mode refers to an execution state in the CPU in which all system memory and all CPU instructions may be accessed. By giving the operating system software greater privileges than the application software, the CPU provides the operating system with a necessary foundation to ensure that malicious or badly programmed applications do not disrupt the stability of the system. The operating system also controls which information users and applications can access. The part of the operating system running in kernel mode is called the kernel.
Conventional defragmentation software runs in user mode, whereas DiskSpeeder runs in kernel mode. This inherently provides DiskSpeeder with a range of advantages over conventional defragmentation solutions.
A defragmentation application runs in user mode and may only defragment a file by interacting with the user subsystem. First, the file is first opened, then a number of MoveFile requests are executed, after which the file is closed again. If the file is locked by another process, or the defragmentation application does not have sufficient privileges to open the file, it cannot be defragmented.
DiskSpeeder does not have this intrinsic problem. It can defragment locked files and system files that user mode application defragmenters cannot. Only a very few protected operation system files are unmovable to DiskSpeeder.
A defragmentation application does not discover a fragmented file until the application is run. The very first thing a defragmentation application does is to scan all files for fragmentation. In other words, files may be fragmented for a long time, if the user is not in the habit of running the defragmentation application regularly. Files that are used often may be severely fragmented without knowing.
Since all I/O requests pass through the Defragmentation Driver, all I/O requests that may cause fragmentation are intercepted. It may for instance occur when a file is created or when it grows. Fragmentation is immediately detected and defragmentation can commence immediately.
A defragmentation application slows down other applications accessing the disk, because it has to share the disk with other applications. The defragmentation application competes with other processes about getting its I/O requests through. Even though many defragmentation applications claims to slow down when disk activity is high, it doesn’t always work that well. Furthermore, if another process tries to delete or exclusively lock a file being defragmented that process will fail, because the defragmentation application has an open handle to the file.
DiskSpeeder encapsulates the file system driver and therefore knows exactly when the disk is active and in which pattern it is active. For that reason, DiskSpeeder can determine when it is safe to do defragmentation without degrading system performance. In addition to that will DiskSpeeder not prevent a file from being deleted or locked while defragmenting.
A defragmentation application typically does defragmentation on demand or at certain intervals. This is cumbersome and doesn’t keep the file system defragmented at all times.
DiskSpeeder doesn’t have this problem. It is always on. Even though DiskSpeeder comes with the user application DiskSpeeder Control Panel, it is only for monitoring and configuration.
The disk is heavily used during Windows startup. All code and data necessary for Windows to run must be loaded into memory. Late in the process are a great number of executable images loaded almost simultaneously, and many of those executables start by reading libraries and configuration data from disk. Needless to say, this induces a great burden on the disk.
DiskSpeeder mitigates this problem by reading some of the data clusters read during boot ahead. That is, before they are requested. In that way the clusters can be read from disk in a more orderly and efficient manner.