Partitioning and Swap File usage

Jun 26 '00    Write an essay on this topic.




Just creating a swap file partition is not the answer to improving the efficiency of Windows' virtual memory subsystem.

First, the potential fragmentation of the swap file is indeed a potential problem, but it is easily solved without the need to repartition your hard disk. Manually set the page file size to 0, both minimum and maximum. Ignore the warnings and reboot.

When the machine is coming back up, press and hold the Shift key to prevent applications in your startup group from launching. Once everything is calmed down and you're at your desktop, perform a defragmentation of your hard disk. When the defrag is finished, set your pagefile at a static size so it won't have the potential to grow. This will ensure that the space it uses on disk is never changed. Set the minimum and maximum values of the swap file to be about 1.5x the amount of RAM in your computer. This is just a general guide and can vary among computers and users.

Now, if you are running Windows 98 SE, you have a handy defrag tool that is much more efficient. It will defrag the pagefile itself, so all you have to do is to set the minimum and maximum values to the same, reboot and perform the defragmentation. Voila, swap file frag problem goes away.

The issue of dedicating a partition to the swap file is worthless in most situations. First, if you configure all of your other disk partitions, then create a partition all the way at the end of the disk, you aren't doing yourself any favors. This will actually result in more head-travel as the disk has to move the heads back and forth, covering more overall distance which equals more latency in request fulfillment.

Also consider that most computers these days come with IDE drives (i.e. ATA). The problem with this bus is that only one outstanding I/O request is allowed on the chain at any given time. This takes the form of one in-progress and one queued (i.e. 2 connections). That said, it's not possible to speed up the overall access of the swap file by dedicating a partition to it, no matter where it is on disk.

Here's where it gets interesting... If you have 2 seperate disks, then I would recommend moving the swap file to the second disk. The outstanding I/O request issue is still in effect, however, it's a request to a completely seperate device, which MAY help speed things up, though it probably won't be noticeable. Better yet, if you have two high-performance IDE Chains, then split the drives between them. Standard EIDE and IDE won't gain you anything, however. I'm speaking mainly to ATA33/66 capable motherboards.

The REAL improvement comes with SCSI and multiple drives. SCSI can have open I/O requests for EACH device on the chain. Also, the CPU of the PC is not responsible for managing the I/O requests. SCSI offloads this I/O to the SCSI controller, thereby freeing up MANY CPU cycles for other things. This is easily seen when comparing the overall CPU utilization of two side-by-side systems performing the same task(s), one using SCSI and the other IDE (or some form of it). This is a very valuable thing to consider. Also, SCSI disk speeds tend to be higher than ATA disks. For instance, there aren't many 10,000rpm ATA disks around, but they've been available in a SCSI form factor for around 2 years now. Seagate just released a 15,000rpm SCSI disk as well, which promises to cut disk latency even further!

SCSI does come with a higher pricetag, but if performance is what you're after, go for a quality SCSI controller and two SCSI disks, then set them up with one as the main disk in use and the other with swapfile and other "data" on it. You will notice a very dramatic improvement in overall system speed.

Ok... disclaimer time. I have skipped over a LOT of details to give you an overview of some facts as they pertain to swap file management (plus the fact that it's nearly 4am here). There are features of ATA that CAN in some situations be taken better advantage of, but they do require a more in-depth understanding of the technology. There are any number of other places to find research material, particularly disk drive manufacturers' sites (Seagate, Quantum, Western Digital, Fujitsu, etc.). Do some homework if you really want to get into this stuff more, otherwise, use the generic suggestions I've laid out above and be done with it.

-Furo


Read all comments (6)|Write your own comment
Write an essay on this topic.

About the Author

Furo
Epinions.com ID: Furo
Member: Randall S. Nieland
Location: Waterloo, Iowa
Reviews written: 35
Trusted by: 1 member
About Me: Newsletter editor Lockergnome.com and owner of MacAquarium.com