Where O where to put the swap file?

topper743

Distinguished
Dec 6, 2007
407
0
18,790
Hi to all. Tomorrow I should be getting two new WD 640gb black 32mg cache hds. I'm going to install them as a raid 0 array. I have been doing alot of reading on the web and I have found alot of miss infomation, and to be fair some good stuff too. I intend to create a C drive with 12 gb of space for the OS and a D drive with the rest of the drive space. After I get the OS installed I want to install my current drive as a data drive. Any pointers would be welcome but my main question is should I place the swap drive on C or D or the data drive whatever letter it finally settles on?

These are the drives. $65 on sale http://www.newegg.com/Product/Product.aspx?Item=N82E16822136319

I'm also getting one of these. http://www.newegg.com/Product/Product.aspx?Item=N82E16819103674
 
I've always heard that putting the swap file on a reasonably fast physically separate drive from the drive with the OS is best, since data swapping doesn't have to slow down the OS drive plus you can get better defragging on the OS drive without the swap file which is unmoveable in XP anyway. So, I'd put the OS on logical drive C:, apps & data on D: and your swap file along with noncritical stuff like music & pix on the E: drive, as long as it is reasonably fast. And although I have used striped drives in my builds for the last 10 years or so, I also have an external backup drive just in case :)...

If you have enough memory, file swaps should be minimal anyway. Max memory for 32-bit OSes is 4GB, although your video card memory will get mapped into that space and reduce it to 3+ GB
 
You've already settled on spreading your C and D drives across the Raid 0 pair, with C being the OS and D "the rest" presumably apps only. These will benefit from Raid 0, and will interfere with each other to some extent.

E will be your "Data Drive", which presumably would have the least frequent access. That seems to be a good place to put the swap file, depending on the drive specs.

You could always try both (D & E) lol. If you can't notice the difference, does it matter :) ?

Personally I stopped using Raid 0. Having a drive failure is, for me, the worst possible PC problem. And reducing my mean-time-between-failures by using a pair of drives as a single drive is not the direction I want to go. Yeah, yeah, I should have good backups . . .
 

topper743

Distinguished
Dec 6, 2007
407
0
18,790
Thanks for the replies. Yes I think placing the swap file in the data/ storage drive would be best. However nowhere on the web could I find tech advice as to the "best" way to do it.

In another note: I ordered this stuff from newegg on tue the 2nd around 8ish CT. I paid for the rush order and I paid for the 2 day air. It is still not here at 1200 MT on the 5th. I called newegg to ask WTF and the chick on the line basically said tough s**t,. If it gets here today it would have been here just as fast just using free ground shipping instead of the $22.50 air which is quite a lot considering the weight was maybe 4-5lbs. If fact her inference was that it was my fault, lol you know the old trick, deny and counter accuse. She was right about one thing if I hadn't ordered from newegg I would be happier now, the ordering from newegg is my fault, probably won't happen again. The online tracking shows that it took newegg 36 hours to get the parts into UPSs hands. So much for paying to rush the order. As I said her attitude was FU. I have ordered quite a bit of stuff from MWAVE.com I think I'll have to go back to them as newegg has given up on customer service.
 


I would contact the head of customer service and complain and ask for a refund of the 2nd day air. When companies get too big for their britches it's time to take them down a notch..
 

jrst

Distinguished
May 8, 2009
83
0
18,630
Short answer: Spread the page file(s) across as many different physical drives as you can, and get it set up right from the start; see thread:
http://www.tomshardware.com/forum/249879-32-pagefile-raid-important-think-setting

If you're going to RAID-0 them, it won't matter much but I'd still strongly suggest putting the page file in a separate partition as suggested in the previous thread. Microsoft also has several KB's and technet articles on this. Recommendations haven't changed much since W2K, all of which boil down to "spread it across as many physical drives as possible and segregate it from other partitions".

If you expect to have much paging activity, the best placement is in the middle of the partition you use for your OS/apps--that tends to minimize seek distance/time when paging--but that is extremely difficult to get set up and maintain. Next best configuration would be to order your partions as: (1) OS; (2) pagefile; (3) apps; (4) other stuff. (I.e., minimize the distance the heads have to travel to reach the page file when under paging load, or in the middle of where the heads spend most of their time. That rule has pretty much stood for decades.)

That said, don't expect that effort to buy you much unless you have a very good understanding of the workload and paging behavior...

NB: physical memory != virtual memory (VM) != required pagefile size. The size of your page file depends on how far you expect to overcommit physical memory, which depends on the VM requirements of the apps you'll be running simultaneously. If you're doing a lot of paging and find you need to do a lot of performance optimizations for the page file, it's a very strong hint that you should get more physical memory instead of screwing around with trying to optimize paging. (To paraphrase Gene Ahmdahl... VM emphasises the need for real memory--it doesn't eliminate it.)

Microsoft's default of 1.5x physical memory for the page file size is a guess, and also a strong hint that if you go beyond 1.5x overcommitment (i.e., VM to physical memory), performance will probably suck. Statements that suggest you can do away with, or minimize, the page file when you have >= 4GB (or any particular amount of physical memory) are nonsense; the size of the pagefile is entirely determined by the amount of VM needed (specifically, memory that is read-write and needs to be committed to the page file), and the VM vs. physical overcommitment level.

At the risk of oversimplification... If you have a combination of apps you run simultaneously that consume 12GB of VM, and that 12GB is read-write data (as opposed to read-only/code), and you have 4GB of physical memory, then you'll need an absolute minimum of an 8GB page file, and likely considerably more. And after trying that once, and waiting, and waiting, and waiting... you'll probably conclude you shouldn't try to fire up all those apps at once until you have a lot more physical memory (i.e., your VM-to-physical commit ratio reduces paging activity to noise levels).
 

sub mesa

Distinguished
There is a difference with having a swapfile, and actually swapping memory because you have too few RAM. The latter should not happen, so very few disk I/O should occur. So why concentrate on the swap file at all? You can disable it if you really want, though it won't hurt much.

Once you start swapping, your PC feels like a Pre-Pentium 1 machine. Your memory now has the speed of barely 1MB/s instead of 4000-8000MB/s. Don't swap, never swap. Its a bad solution for the wrong problem.
 

wuzy

Distinguished
Jun 1, 2009
900
0
19,010
Some programs like Photoshop won't work without a swapfile present unfortunately.
Due to that requirement I just move it onto another HDD so it won't get in the way of the OS+app activity if it's ever used. Moving it to another partition (of the same HDD) will hurt performance instead as the head has to move back and forth between main and secondary partition on the platter.

In XP days I also set maximum and minimum size for swapfile the same i.e. making it static so it won't be spreaded all over the platter of HDD if it's resized.
With introduction of Vista I don't do that anymore as the above problem has been dramatically improved and I just let Windows manage it now.
 

sub mesa

Distinguished
Alright but actually swapping is a bad thing for any modern machine, and machines with enough memory using disk space to emulate memory is a crazy way of solving problems with bad solutions, IMO.
 

wuzy

Distinguished
Jun 1, 2009
900
0
19,010
I also want to understand why in few rare circumstances the swapfile can't be eliminated when there's enough physical RAM either. Exactly what gets paged out to swapfile I'm not sure, but it would seems something is paged out when swapfile isn't disabled.

With it enabled I can't really feel when it's being paged or not so I'll live with it as that's what Photoshop requires. Never goes above physical RAM usage anyway.

I have always wanted to experiment with swapfile on RAMDisk tho and to do that I'd have to set the swapfile to be cleared after every shutdown (or so I've heard).
 

mikrev007

Distinguished
Oct 28, 2008
264
0
18,790


Yes it will, as long as you have enough free ram.
 

topper743

Distinguished
Dec 6, 2007
407
0
18,790
I want to thank everyone for the very informitive replies.

Well the gear finally arrived late yesterday. I talked to the UPS guy and he said that Newegg nearly always takes two days which what was posted on my package. So I ordered at about 7pm local here on the 2nd and newegg got it into UPS hands at about midnight on the 3rd according to the tracking info sent by newegg. I ordered some stuff from ne back in Dec 08 it took them about 10 days including a weekend. I know that folks have had a good experience mine not so much. Probably the the attitude of the person on the phone rewritting history. Are you going to believe your lieing eyes or what I'm telling you was her point.

Anyway I did get the drives and installed the drives as Raid 0. I placed the Swap file on the old drive at a size of 6990MB. My old drive was as WD 250GB AAKS. I ran a HD tune on both.

Old
min 38.1
max 79.1
av 63.e
access 13.9
burst 118.6
cpu 1.3%

New
Min 92.1
Max 138.3
av 125.3
access 13.9
burst 114.6
cpu 3.1%

The avg in the benchmark is very constant in it's graph with just one little dip down at the begining of the test where the old drive started off high and dipped down towards the end of the test.

I debated over a faster hd say 10k or 15k and also a SSD. I tried to weight the benefits v cost. I don't feel like an SSD is price worthery yet, I almost went with a single raptor. I got a thing in email for $10 off each of the 640 drives so that is what swayed me. I think that it's good to experiment with different stuff. Something that threw me a bit is the size of the raid. 1.2TB, I thought that it would be 640. After reading this article all is as it should be, I just have space for days. When the SSDs get it together more I'll probably make that jump. Check this out from Anandtech it goes back a bit but probably is still relivent. Be sure to notice the bottom line.

By the way very happy with the Phenom 2 955 oc'ed to 3.8ghz very easily and able to get 17.5k on 3dmark06 using the same old system parts.

****************************************************
http://www.anandtech.com/printarticle.aspx?i=2101
If you haven't gotten the hint by now, we'll spell it out for you: there is no place, and no need for a RAID-0 array on a desktop computer. The real world performance increases are negligible at best and the reduction in reliability, thanks to a halving of the mean time between failure, makes RAID-0 far from worth it on the desktop.

There are some exceptions, especially if you are running a particular application that itself benefits considerably from a striped array, and obviously, our comments do not apply to server-class IO of any sort. But for the vast majority of desktop users and gamers alike, save your money and stay away from RAID-0.

If you do insist on getting two drives, you are much better off putting them into a RAID-1 array to have a live backup of your data. The performance hit of RAID-1 is just as negligible as the performance gains of RAID-0, but the improvement in reliability is worthwhile...unless you're extremely unlucky and both of your drives die at the exact same time.

When Intel introduced ICH5, and now with ICH6, they effectively brought RAID to the mainstream, pushing many users finally to bite the bullet and buy two hard drives for "added performance". While we applaud Intel for bringing the technology to the mainstream, we'd caution users out there to think twice before buying two expensive Raptors or any other drive for performance reasons. Your system will most likely run just as fast with only one drive, but if you have the spare cash, a bit more reliability and peace of mind may be worth setting up a RAID-1 array.

Bottom line: RAID-0 arrays will win you just about any benchmark, but they'll deliver virtually nothing more than that for real world desktop performance. That's just the cold hard truth.
 

wuzy

Distinguished
Jun 1, 2009
900
0
19,010


Google it. It's a widely known problem. A few other Adobe products does it too. In XP days and with older version of Photoshop at least it'll ask you to re-enable swapfile.
I havent't tried it with Vista + CS4 which is what I'm using now.
 

jrst

Distinguished
May 8, 2009
83
0
18,630
wuzy -- A bit OT, but...

Applications may allocate VM requiring corresponding allocation ("commit") of pagefile space. That doesn't necesssarily mean the app will use/access all of the space. (Allocating VM and reserving or committing space are actually two different steps; some apps do it incrementally as needed.)

An application might want to commit that space--even if it might not be needed--because it doesn't want to be caught short in the middle of something and you end up with an error message and lost work (because other apps were also chewing up space in the mean time.)

I don't think you'd notice much of a difference putting the pagefile on a RAM disk; more likely a decrease in performance. There's also quite a bit of paging activity that doesn't touch the pagefile.
 

wuzy

Distinguished
Jun 1, 2009
900
0
19,010
Thanks for the explanation, appreciated. :)
I guess I'll just leave it on then for compatibility reasons. As you explained above it's hardly going to be used if at all which is what I've observed.