VuULF Dot Com Geek, Tweak and Game


Optimizing Your Swapfile – Step 1

In order to optimize your swapfile you should first ascertain the fastest hard drive you are using. If you are using a single hard drive, then you can skip to Step Two. However if you have multiple hard drives or RAID arrays, you will definitely want to put your swapfile on the fastest available hard drive. Basically what I will show you here is how to determine which is your fastest hard drive using "DiskSpeed". Then we will defragment that hard drive completely and finally we will adjust the swapfile to a reasonable fixed size for your system.

A few myths that should be dispelled. Myth on is that the swapfile should be twice the size of your RAM. This is just inaccurate. Even in a gaming environment, the swapfile is not used as much as you'd think. A large swapfile is good for kernel dumps on blue screen, and for caching a lot of served data. For day to day use, however, maintaining an overly large swapfile is just a waste of space. A good size on the Vista platform is around 2 gigabytes. This leaves you oodles of overhead, and with today's high capacity hard drives, takes very little room. The second myth is that the swapfile should be on a separate hard drive than the system. This, simply put, is not true. If you score an average of 700+ on one hard drive using DiskSpeed to test your drives and an average of 600+ on a second hard drive using Disk Speed, you will still be better off using the hard drive that scored higher. If your secondary hard drive scores roughly 25 points less or better when testing with DiskSpeed then you should use the secondary disk. While a lot of files will come from your primary, or C:\ drive, unless your secondary hard drive scores are near equal to that of the C:\ drive, you will actually lose performance by putting the swapfile on the secondary drive. Keep these items in mind as we walk through the tutorial.

Note: This tweak will work equally as well in Windows Vista, XP and 2000, however, this article will primarily cover tuning for Windows Vista. If there is enough demand for tweaking XP then I will post a secondary tutorial for that.

Step 1 - Determining Your Fastest Drive

If you have multiple hard drives, and are not certain which drive is the fastest, you should perform this step and isolate which drive will be the best candidate to hold your swapfile. The faster the hard drive performs, the better. If you have only one hard drive, and aren't at all curious as to the speeds it achieves, you can skip this step.

First you will need to download a good tool to benchmark your hard drives performance. While there are a plethora of great tools, the one I choose to use is a freeware application called DiskSpeed. You can find DiskSpeed at the following URL. or for a direct download of the file without the authors information

Download the program and unzip the file using your favorite decompressor (I prefer 7-Zip, but that's a different article altogether...). You should now have an icon in a folder called DskSpeed.exe with a picture of a cat on it. Since I am assuming you are using Windows Vista, and are smart enough not to have turned off UAC, you will have to run the program with Administrative options set. To do this, either right click the DskSpeed.exe and click Run As Administrator and click Continue on the UAC screen, or, the better option, permanently set this file to run using the Administrator by right clicking the DskSpeed.exe file and then click Properties. You will be presented with a standard properties screen. Click the Compatibility Tab and then put a check in the box in the Priviledge Level pane which says Run As Administrator.  You should have something that looks like the following:

DiskSpeed Properties Set To Run As Administrator

DiskSpeed Properties Set To Run As Administrator

Now click OK and then run the DskSpeed.exe program, selecting Continue on the UAC system prompt. You will be greeted with a simple interface which will allow you to select all of your hard drives from a pull down menu. You should run this test on all hard drives that are present in your system.  If you have multiple partitions per drive, just run the test on the first partition of the hard drive and/or the partition that houses the most space. If you are unsure if you have multiple partitions on a single hard drive vs. more than one physical hard drive then you can probably assume you have multiple parttions. Why else wouldn't you know if you had more than one hard drive? If this is your case, simply run the test on C: if you are curious to see what speeds you get, and skip to Step 2. The number you should be most concerned with for the sake of this test is the Overall Score. The higher your score, the faster your hard drive runs, therefore making the drive with the highest score the best candidate to hold your swapfile. Here are a few screenshots of DskSpeed.exe in action. The first demonstrates the GUI for the DskSpeed.exe program. The second shows the final result of my first hard drive and the third shows the final result of my second hard drive.

Disk Speed GUI

Disk Speed GUI

First Logical Hard Drive (2xMastor SATA RAID in my configuration)

First Logical Hard Drive (2xMaxtor SATA RAID in my configuration)

2xWestern Digital PATA RAID in my configuration

Second Logical Hard Drive (2xWestern Digital PATA RAID in my configuration)

As you can see, my first hard drive outperforms my second hard drive by almost a full one hundred points. This mean that I would be best off keeping my swapfile located on drive C:\. If the Overall Score was closer, say by about 25 or so points, perhaps even closer to 15 with todays hardware, then we could test to see if the performance would increase by placing the swapfile on drive D:\, however, as it stands, we want to keep the swapfile on drive C:\ using the scores I achieved.

Now onto STEP 2

Comments (0) Trackbacks (0)

No comments yet.

Leave a comment

No trackbacks yet.