Basic computer maintenance
Every day I come across various machine configurations; some are fantastic and others…well, let’s just say I wonder how in the heck they are still able to work.
People seem to forget that they need to maintain their computers. Clean up the temporary files, run a disk check, run a defragmentation program. It’s not a difficult regime, but one that many people seem to forget.
It certainly surprises me how many Windows Servers I come across where the very active main data partition has _never_ been defragmented. I came across such a beast this week. The data partition was only 69% full. This particular installation of Windows has been running since Windows Server 2003 R2 came out and had never, from what I could see, been defragmented. The data partition holds the main fileshares, and also is the storage filesystem for some SQL databases.
The main SQL database was 19GB in size. It had over 140,000 fragments. Yes, an average and median of approximately 140KB/fragment. Running a speed test on the drive before anything was done to it yielded 10MB/sec transfer. Pretty horrific when you consider that this is a server in a RAID 1 configuration.
I had to remove temporary files and use custom scripting in a third party defragmentation application just to allow large enough contiguous free blocks to allow us to defragment that behemoth.
So when all was said and done I got to perform another speed test on the drive. It yielded an average transfer rate of 60MB/sec. Thats right, a 6-fold improvement in direct performance on the drive itself.
It’s amazing what a little maintenance can do.
I think that a lot of non-technical types wonder why we should need to perform this sort of maintenance as they don’t understand what is going on “under the hood”.
When you want read a file off the disk, the computer has to request the start of the file from the hard drive. The drive positions the head while the platter is spinning, and when it reaches the right “track”, it has to wait for the platter’s spin to place the start of the track under the drive head.
When the data is fragmented, the head has to reposition itself to get the subsequent pieces and wait for the spinning platter to rotate so that the correct data is under the head. Each “seek” for the next bit of data comes with a time penalty.
What happens when your file is in 140,000 pieces? To read the entire file you have to endure 139,999 extra head repositions and wait-time for the platter spin to place the right part of the track under the head. When you read in a file, you ideally want all the data to be in one piece, or as few pieces as you can manage.
In a future post, I’ll talk about fragmentation, what causes it, how we can prevent it, and how sometimes it can be a good thing.