PDA

View Full Version : Swap file tweaking with multiple hard drives


SixIron
10-21-2006, 12:35 PM
XP Pro, SP2
X2 3800+ w 2 x512 DDR 400 in dual channel mode
250 gig WD SATA II boot drive that Windows is installed on
80 gig Maxtor SATA I data drive
80 gig Maxtor SATA I second data drive

I was contemplating a clean install of XP because things seemed sluggish clicking between different open programs even though only about half my ram was in use. I checked my swap file, it was all on C: 1.5 to 3.0 gig variable size swap file. I changed it to fixed sizes, 128 meg on C, 768 each on D & E. Rebooted, loaded up the same usage as before and shit my knickers at the increased responsiveness.

I also frequently unrar or copy large files (single and dual layer DVD type stuff) from one drive to another. I haven't done any of that yet since modifying the swap file and I want that to continue to be fast. Anyone have similar experience to recommend further swap file tweaking?

Oklahoma Wolf
10-21-2006, 12:37 PM
I have a seperate 2gb partition at the front of my 200gb Maxtor main HD just for my swap file :)

davidhammock200
10-21-2006, 12:57 PM
Set to fixed size equal to up to 3X the amount of RAM, not to exceed 4GB on a 32-bit OS.

Put on each "stand alone" HDD & each HDD array.

Example: 2GB RAM, put 2GB swap file on C, D & E. ;)

Bbq
10-21-2006, 01:13 PM
Oklahoma wolf, the Maxtor 200gb SATA 150 16mb cache?

:eek: Mine went after 3 hours. They did replace it with a 300 though. which is working flawlessly.

Oklahoma Wolf
10-21-2006, 01:19 PM
That's the one... mine's been solid for 10 months now ;)

CAD4466HK
10-21-2006, 03:42 PM
Oklahoma wolf, the Maxtor 200gb SATA 150 16mb cache?

:eek: Mine went after 3 hours. They did replace it with a 300 though. which is working flawlessly.

I've had one of those now going on 3 years, zero problems:D

MrWicked1968
10-23-2006, 02:09 AM
I have a 1.5gb (1gb of ram) swap file set on a 2gb partition on my only internal hard drive.

I don't see what purpose it would serve having multiple swap files if you're only running one operating system at a time.

davidhammock200
10-23-2006, 06:27 AM
I have a 1.5gb (1gb of ram) swap file set on a 2gb partition on my only internal hard drive.

I don't see what purpose it would serve having multiple swap files if you're only running one operating system at a time.On seperate HDD's & seperate HDD arrays, it allows the OS to use the fastest access. ;)

Rubycon
10-23-2006, 06:35 PM
I have a 1.5gb (1gb of ram) swap file set on a 2gb partition on my only internal hard drive.

I don't see what purpose it would serve having multiple swap files if you're only running one operating system at a time.

32bit OS limit you to 4095MB per paging file. You can get around this with using more drives.

SixIron
10-23-2006, 07:43 PM
So far, putting swap on all three of my hard drives has definitely paid dividends. I'm still tinkering with sizes, so far it seems the smaller the total swap size, the more repsonsive XP seems to be. I'm still looking for the elusive balance of having enough, yet maintaining the reponsiveness. The 128/768/768 setting seems pretty sweet. I haven't moved the swap totally off c: yet so my final settings are yet to be determined.

davidhammock200
10-23-2006, 10:17 PM
Assuming 2GB RAM, the smaller the swap file the better for gaming,
for Photoshop & video editing, the larger the better. ;)

XBarbarian
01-06-2007, 12:11 PM
I got some good insight on this page about swaps..etc..

Found a few links thru a discussion on [H], and this though a little older, makes sense...

http://aumha.org/win5/a/xpvm.php

On my last build..which is old now ..I tried a bunch of different scenarios on ide's

on 2 physical drives, both 40gb maxtors

drive 0: c:\ ( os only, and of course the unavoidable prog pieces - 8gb ) and E:\ apps ( games, etc.. - 32gb )

drive 1: d:\ (3gb swap only..mapped here.. tried various min-max settings..ended with let windows manage seeming best ) f:\ data ( 37gb - installers, downloads..etc... )

My new rig is raid 0 2x Raptors for c:\ just os and apps.. not sure what Ill do about swap there. and a 3rd drive 500gb WD sata 2 16 for data. May try popping a swap on that too..just for good measure

Slartibartfast
02-17-2007, 01:18 AM
Storage space is so cheap you shouldn't skimp on a swap file. I run 4gb swap files on each HD, along with 4gb physical RAM. It's also a good idea to make it a set size, as you have done, because otherwise it will fragment.

Lenny_Nero
03-08-2007, 05:20 PM
I only run a 500 MB swap on my 2 GB rigs because its a small bit faster, or seems so. I have messed with cluster sizes but I dont think this can make much difference. Its also not a problem if windows wants/needs more it just asks and I give it more... not that this happens much.
This is on Win2000 (only Win OS I use) but I expect that XP is the same.

uOpt
03-11-2007, 08:21 PM
Paging space should always live on all physical drives. Adjust the priority for the partitions/files according to expected speed, e.g. give a Raptor higher priority so that it gets used more. The size of the paging partitions/files does not influence the usage, you need to use priorities for that.

Do not listen to people who recommend to keep swapspace off "data drives" or off you OS boot drive. That advice is bogus for pretty much any workload a home PC or workstation can produce.

Never run without paging space, even if you have enough RAM to hold all programs and their data.

If you have various RAID levels, keep swapspace off raid-0s, load it directly onto the underlying disks before RAID-0 (then do raid-0 on the rest of the disks for filesystems). Whether you need to put it on redundant raid or not depends on whether you want to survive disk crashes without a reboot (true hot-swap). Only if you need the latter you should use use redundant raid for swapspace, and then you want to sort it out to have clearly identifiable sets of disks behind each paging partition/file, and as few disks as possible.

Lenny_Nero
03-12-2007, 07:34 PM
I only have one swap file on one drive/partition (same as Oklahoma Wolf just a 2'ish GB partition) for all of the boots (OS installs) I use on any computer. They all point to the same file/place that gets defragged on every re-boot.

I never have it on the same drive as any OS installs as this will slow it down.
I have never seen/read the need to have one for each physical drive... I would need 6 in this computer alone...

As for 'bogus' advice to not have it on data installs... well if you can get your OS to stop running everything (services included) and so stopping the need to move data on and off of the disk, then yeah it will be ok else it will 'always' be faster on a drive that is not being accessed for data.

davidhammock200
03-12-2007, 07:57 PM
Page/swap should exist on all physical drives,
as this gives the OS its greatest opportunities to use the fastest & most accessable drive.

Try it, you will like it, what have you got to lose? ;)

Lenny_Nero
03-13-2007, 06:36 PM
Just the fact that I will then have 6 page/swap files, on this computer, and what size should they be ? 6 x 250 MB ? or 6 x 80 'ish MG to keep it at the same size as I have now?

So what will windows then do, use them all at once or just try one at a time, or add it up as one fragmented unit... I very much doubt that it will be as fast as just one on a single fast disk that has nothing ever using its partition, and that gets defragged and renewed on every re-boot as I have set to do now that only adds ~20 seconds to a re boot, but will be well over a minute to go thru all 6 of them.

I also find it strange that I have never heard this before (Page/swap should exist on all physical drives) and I would say its the single question I have seen and been asked the most over the years in Usenet and from people I meet everyday ?

But next time I can be bothered I will try it, I have a fresh/clean install image and a load of un allocated space on my x2 box.

davidhammock200
03-13-2007, 07:07 PM
Page/swap file size should be 2X to 3X the size of usable system RAM, not to exceed 4GB, per physical drive. :wall:

Darth Brooks
03-13-2007, 09:40 PM
I'm intrigued by this from uOpt:

If you have various RAID levels, keep swapspace off raid-0s, load it directly onto the underlying disks before RAID-0 (then do raid-0 on the rest of the disks for filesystems).

Why not RAID0? Not trying to say it's wrong, I just want to know why. I could definitely understand redundancy arrays like a RAID1 or even 5. But I would have thought a RAID 0 array would give a little more throughput to a bandwidth starved process.

uOpt
03-14-2007, 01:13 PM
Why not RAID0? Not trying to say it's wrong, I just want to know why. I could definitely understand redundancy arrays like a RAID1 or even 5. But I would have thought a RAID 0 array would give a little more throughput to a bandwidth starved process.

If you have several swap areas on different drives they are all used at the same time. The OS knows which ones are on several disks.

Let's say it want to page out 1000 page (4 MB):
- then it pushes page 1,3,5, 999 to disk 1
- page 2.4...1000 go to disk 2

(except it isn't this sharp, random block can go to random locations, but the point is, both disks are use the same way, unless they have different priorities).

Obviously, this is very fast as both disks work in parallel. While one is seeking and writing the other one can also seek and write without waiting.

If you put swapspace in one area on a rwo-disk raid0 instead of two areas on two disks then the OS has no idea which block in the paging area is located on which drive and it essentially becomes random. And you will inevitably end up loading one disk more than the other and hence cause a slowdown compared to two plain areas.

The above is ten times worse on Windows than on typical Linux/FreeBSD installations since Windows usually has swapspace in files, not partitions. On swap partitions you might accidentally end up with a pattern that load both disks in raid-0 about even, but if it is in files in a filesystem it is entirely thrown off.

Darth Brooks
03-14-2007, 05:33 PM
Ok. I would buy that. Thanks for the explain.

But, lets say you have 2 or 3 different RAID 0 arrays. One would be the main array with your OS partition. Then on each subsequent array, you make a 2 or 4 GB partition and set a paging file to each. Then you leave a small one on the C: drive for the kernel debugging thing.

Would that still fall under what you pointed out?

uOpt
03-14-2007, 08:06 PM
Ok. I would buy that. Thanks for the explain.

But, lets say you have 2 or 3 different RAID 0 arrays. One would be the main array with your OS partition. Then on each subsequent array, you make a 2 or 4 GB partition and set a paging file to each. Then you leave a small one on the C: drive for the kernel debugging thing.

Would that still fall under what you pointed out?

2 o 3 different raid-0 sets over 4-6 or more disks would be much better than one raid-0 over 4-6 disks, as far as paging space is concerned.

What you really want is partitioning below the raid levels so that you can keep the paging space unraided and the filesystem space raided.

Darth Brooks
03-14-2007, 09:10 PM
Very interesting. Although not done easily with low-end onboard RAID controllers. Thanks again. Good info.

mp666
03-15-2007, 12:08 PM
Page/swap file size should be 2X to 3X the size of usable system RAM, not to exceed 4GB, per physical drive. :wall:

Hi David,

This 2x to 3x advice is a leftover from the days of systems with 128 MB max RAM. Actually the more RAM you have the less swap space you need. Of course this amount change for different usage patterns. For most people with 1 GB or more RAM a pagefile of 1 GB is more than enough.