Swap File Optimizations? 177
fastswap asks: "I've got a pretty standard computer with reasonably fast drives. I've got an old 2GB-but-fast drive, and a spare channel on the motherboard. Does it make sense to install the 2GB drive on its own controller and use it for a dedicated, fixed swap file? I figure if the computer's using the swap file, then in the current setup with the swap file on the primary controller, then it's contributing to hard drive thrash exactly when one doesn't want it to (i.e. when the machine needs the swap file). If it is better to have a dedicated swap file on its own controller, is the same true for other operating systems with similar approaches to virtual memory? Since drive space is so cheap now, should the swap file be fixed size anyway rather than letting Windows suddenly get the urge to resize the thing?"
Erm (Score:2, Funny)
The flaw in your argument... (Score:2)
Swap partitions are even faster, but MS Windows can't do those.
Re:Erm (Score:2)
Mod parent up!! (So we can laugh at him!)
swapping? (Score:4, Interesting)
Re:swapping? (Score:4, Informative)
Re:swapping? (Score:2)
Re:swapping? (Score:5, Funny)
No, seriously.
I don't know what the hell kinda easter egg's in Word - I know Excel had a flight sim , maybe Word's got a 5 minute video of BillG rolling naked in a pile of money and whores.
Re:swapping? (Score:2)
Bill's horse pic in win95. From which we
can reliably conclude that he prefers horse
to whores, although the statement is
misleading in some ways.
re: Easter eggs (Score:2)
So assuming there were something as large as a 100 MB Easter egg, it wouldn't take up much memory until you found it.
Re: Easter eggs (Score:2)
Re:swapping? (Score:2)
Re:swapping? (Score:2)
Re:swapping? (Score:2)
Re:swapping? (Score:2)
Yes this post was just an excuse to tell people that I have a new computer :-)
Re:swapping? (Score:2)
Yes, swap is still important to many people, even those with 512MB of RAM or more. With a dozen xterms, Mozilla, OpenOffice, etc. open, starting something like a MCAD application makes swap very very useful (if the OS is efficient about it, that is). Using swap doesn't necessarily mean slow performance, if the OS does a one-time dump of unused pages to the disk allowing the one big app to take what it needs. Switching among several large apps, though, means a purchase order for more RAM is in order.
Re:swapping? (Score:2, Interesting)
> got 512 megs of ram.
I make it a point to have enough RAM that the system almost never has to use
the swap space, but I consider it vital to have the swap space there as a
safety net, because occasionally something uses a whole lot of RAM (e.g., I
might write a quick-and-dirty use-once-and-throw-away Perl script to process
some data, and it might store them in a Really Big Hash while doing so, or I
might have to work with an image in Gimp that's intended to be printed at
600dpi at 8x10 inches, and I might forget to turn down the length of the undo
history and perform several memory-intensive operations on the image), and
the Linux kernel has a tendency to react rather badly to running out of both
memory and swap space. So, as cheap as drive space is, I like to have plenty
of swap space available for such occasions. Usually, it's 0% used and 100%
available, but I consider it an important safety net. I like to have several
gigabytes of swap space, Just In Case.
However, if you're using the swap space often enough that you want to optimize
its speed by putting it on a separate controller, I recommend more RAM instead.
Re:swapping? (Score:2)
Fixed size... (Score:5, Interesting)
You only mention Windows towards the end of your question so I can't tell whether or not you're looking for a Windows answer. I've always allowed Windows to resize its swap file, but within a small window. This machine (Win2K) has 640 megs of physical RAM, and the swap file is set at 1280 minimum, 1960 maximum; that gives Windows "double the real RAM," but not a license to take over the whole drive. Seems to work well for me.
I've never tried putting the swap on its own channel or controller - or even on its own drive - under any OS. Like you, I'd be interested in hearing whether or not this is worth the trouble.
Re:Fixed size... (Score:3, Informative)
Re:Fixed size... (Score:3, Informative)
Re:Fixed size... (Score:2)
And a real question: what do you do when you subsequently add more RAM?
Re:Fixed size... (Score:3, Informative)
I still do this, but with 1G of RAM, I never swap anymore. Back back when I had a 100MHz system and 32M RAM, putting the swap on another harddrive made a significant difference. That was with Linux. Since Windows uses a swap file instead of a raw partition, so it might not make much of a difference.
Re:Fixed size... (Score:3, Informative)
Re:Fixed size... (Score:2)
Re:Fixed size... (Score:2)
1
Re:Fixed size... (Score:2)
In most cases, servers should never swap; most systems these days only have swap as a space for crash dumps; both Solaris and Windows do this.
Also, as others have said, leave Windows page files at a constant side to avoid fragmentation; this is one thing which the *nix world has definately got right.
Re:Fixed size... (Score:2)
Re:Fixed size... (Score:2)
I'm not flaming or trolling, I'm serious. Even if running a GUI (which never happened in the days of 16Meg machines, and don't mention X Windows because I know for a fact the serious number cruning workstations didn't waste their precious RAM on X -- remember, we're talking "back in the day" here) even if running a GUI sucks up the RAM we could go an order of magnitude higher these days, to 640Meg. That oghta cover KDE or Gnome. So why should a modern computer need any swap space, let alone twice as large as today's typical RAM?
Re:Fixed size... (Score:2)
Re:Fixed size... (Score:2)
Re:Fixed size... (Score:2)
Before vmware (Win98 session, with 164MB of Ram alloc:)
free
total used free shared buffers cached
Mem: 516196 232612 283584 0 24876 85448
-/+ buffers/cache: 122288 393908
Swap: 771040 0 771040
--Same machine, with vmware session running (no programs active in the VM yet, just OS)
free
total used free shared buffers cached
Mem: 516196 400996 115200 0 30616 233340
-/+ buffers/cache: 137040 379156
Swap: 771040 0 771040
--And now Opera running in the VM session, with 6 windows open:
free
total used free shared buffers cached
Mem: 516196 460160 56036 0 32272 288116
-/+ buffers/cache: 139772 376424
Swap: 771040 0 771040
--Note that the swap usage is *still* Zero.
--As far as EMACS goes... Well, there's always "jstar".
Re:Fixed size... (Score:2)
--But notice - even with all that running at once, you're still using much less than 256MB of swap. You could probably resize that 1GB down to half that, or even 300MB - and still have plenty of leeway. If you're using KDE, I'd consider switching to a more lightweight WM (I use Sawfish, but that's prolly too bare-bones for most people) and you'll save even more resources.
Re:Fixed size... (Score:2)
The only problem with this (which doesn't make much sense in my mind) and as a caveat, I would say for "modern OSs", why would you need to double the amount of swap for more RAM you put in the system? You'd think that you would need to use a decreasing amount of swap with the more memory you put in your system?
The only thing I could possible figure out, is that if ALL your RAM dumps all of its memory to the swap at once; but again, what OS does this, I'm quite sure that Linux (modern) doesn't do this, are there any modern OSs that do this?
Re:Fixed size... (Score:2)
I've always found storing Swap/pagefile on a separate drive off my main drive has given me better performance especially when running data mining/modelling or video editing software. Video capturing to a drive that is sharing your Pagefile can be a real drag.
Maybe using a separate channel will result in bandwidth increases for the writes and reads on the swap disk. Eh??? But if it did, considering the speeds we're dealing with today, would it even make a noticeable difference?
For security, I like to put my pagefile on the dame physical drive I store other short-term data (emails, photos, etc - anything personal not put to disc right away). The reason is that I figure the pagefile contains a lot of data that might be personal. Is there any sense to this? I also have Windows set to delete the pagefile on shutdown so...
Re:Fixed size... (Score:2)
--Example: 900MHz AMD Duron, 512MB RAM
swapon -s
Filename Type Size Used Priority
free
total used free shared buffers cached
Mem: 516196 232612 283584 0 24876 85448
-/+ buffers/cache: 122288 393908
Swap: 771040 0 771040
--Note that the swap "Used" count is Zero.
--Granted, all I have running ATM is Opera, rxvt, Konsole, Sawfish and a few daemons. But even recompiling the kernel will only use <100MB of RAM (usually much less.)
--Monitor how much swap you use on a daily basis with various tasks. I'll bet you can resize your swap partition down to == the RAM or even a bit less, if you're not worried about suspend-to-disk.
--From personal experience, the more RAM you have - the less swap you need. If you have installed 256MB-512MB of RAM, unless you're *really* pushing the machine, you only "need" about 300MB of swap.
--If you've got ~128MB of RAM (typical older Windoze machine), 300-400MB of swap should be fine even if you're running KDE, XMMS, and a kernel compile all at once.
--1GB of swap actually being *used* is almost unheard of, even if you only have 64MB of RAM; the machine would be so slow as to be almost unusable, and eventually the hard drive would go up in flames from disk thrash. (I've seen it happen with XP. I think the client had only 128MB of RAM installed, and XP swap thrash forced us to reinstall and repartition the disk around the bad sectors.)
--AFA putting the swap on its own drive - Make sure the drive can handle DMA. If you implement it and it works well enough that you don't notice the difference, go for it.
stupidassfkgslashdotlamenessfilter-POS-Ireallyf
Re:If security is a concern (Score:2)
http://support.microsoft.com/support/kb/article
Or you can do it with a GUI. Control Panel -> Administrative Tools -> Local Security Policy -> Local Policies -> Security Options -> Shutdown: Clear Virtual Memory Page File -> Enabled
Dedicated (Score:2, Informative)
Yes, seperate drive and fixed size (Score:5, Interesting)
It is important to note that WindowsXP will use the page file whether you've got plenty of RAM or not.
Re:Yes, seperate drive and fixed size (Score:2)
Seems counterintuitive. Does anyone know why this is ??
Re:Yes, seperate drive and fixed size (Score:2, Informative)
Joe User would have a machine with 4MB RAM and 8MB swap for his word processing and Ultima 2 or whatever.
Stan Scientific would have a machine with 32MB RAM and 64MB swap because he probably was going to eventually have to deal with datasets larger than 32MB (if you've done ANY scientific computing over historical datasets, you know what I mean).
Basically, more RAM implies you should be swapping less, for a home system.
But for a server or high-end processing computer, more RAM implies you need vast amounts of RAM in general, and swap doesn't hurt.
Re:Yes, seperate drive and fixed size (Score:2)
The other reason is that you have some recurring processes(scheduled tasks, crons, disk defrags) that run at times when the machine is supposed to be idle, but may just be busy. With larger swap, you avoid a crash, by risking more swapin/swapouts.
Re:Yes, seperate drive and fixed size (Score:5, Informative)
You can instruct XP (and probably 2K) to not page the executive and to use more memory as cache space. This reduces the amount of paging significantly.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Session Manager\Memory Management
*Change DisablePagingExecutive to 1
*Change LargeSystemCache to 1
*Reboot
Re:Yes, seperate drive and fixed size (Score:3, Informative)
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contr
*Change DisablePagingExecutive to 1
*Change LargeSystemCache to 1
*Reboot
True, but doing this disables standby and hibernate modes, since the kernel can't be unloaded any more. If that's not a problem for you, go ahead of course, but it's worth being aware. I did this, and kept finding my system going into standby on request, but never resuming, and it took me ages to find out why...
Separate swap under linux. (Score:4, Informative)
Dedicated is better; linux lets you RAID it (Score:2, Informative)
However, you will never get true swap performance using Windows.
To do that you need a real operating system. Linux will let you put one swap partition on each controller, set them to the same priority, and it will automatically spread the access between them, getting a RAID-like speedup in your swap access times.
Also, remember to put swap partitions (if you are using files you are hopelessly fucked) on the end of the disk, so that they will be on the outer sectors where the transfer rate is fastest.
Re:Dedicated is better; linux lets you RAID it (Score:2)
Re:Dedicated is better; linux lets you RAID it (Score:2)
The exception is the 'storage' drive on the server, and that's only holding files, not serving as a swapper or system volume.
I've had the best luck in 2.6 with using a swapfile instead of a partition, and making the swapfile with 'dd' and 'mkswap' after the base system is installed and before I lay down all the other stuff. That places the swapfile close to the most-used application files and towards the outer end of the disk. I use a 512MB swapfile on all of my machines, most have 512-1024MB RAM and since I've been doing things this way I've only ever used about 3MB of swap (linux pages out unused stuff after a while).
2.6 has a system whereby it can use a swapfile just as efficiently as a separate partition (it bypasses the filesystem layer to access it?).
Re:Dedicated is better; linux lets you RAID it (Score:2)
How do you know? One of the features of ext2/3 is the way it avoids fragmentation by randomly placing files all over the partition, unlike FAT16/32 which fills the partition from start to end.
The only way to optimize the location of swap space in Linux is to use a dedicated swap drive, or place the swap partition between
Advocating the swapfile instead of swap partitions (Score:2)
Even with multiple drives, running swap and '/' on the fast one might be advantageous, my drive has an 8MB buffer, and most writes to swap are much smaller than that, while an old 2GB drive likely has only a 512K buffer. If there's 4MB that the kernel wants to page out it'll go at 'wire speed' to the bigger drive, while the older 'dedicated' drive might have to swallow it in chunks as it commits.
The real question is why should we worry about swap optimization AT ALL. I've got a 320MB system and it's never used more than 15MB of swap, and the activity on the swap was absolutely minimal. My 'bigger' systems almost never page out. You're much better off just making a smallish swapfile inside your filesystem and not having to deal with any more partitions than you need, the small amount of sanity this affords you should greatly outweigh the 'half-second over three weeks' of difference it makes in performance.
Re:Dedicated is better; linux lets you RAID it (Score:2)
So will Windows (NT, 2k, XP).
Also, remember to put swap partitions (if you are using files you are hopelessly fucked) on the end of the disk, so that they will be on the outer sectors where the transfer rate is fastest.
Putting them in the middle of the disk to minimise seek time would be a better plan - swapping generally entails lots of small, random reads and writes, not long, continuous reads and writes. Not that physical location makes a whole lot of difference these days.
Re:Dedicated is better; linux lets you RAID it (Score:2)
It depends on the disk manufacturer. It's fairly easy to tell though. Modern disks have track zones, with a different number of sectors per track in each zone. The length of a track increases towards the outside of the disk, so the zone with the most sectors per track is the outside of the disk. On scsi disks you can get the zone data with the scsiinfo utility under linux.
Linux Swap Space Mini-HOWTO (Score:4, Informative)
Good Results (Score:3, Interesting)
I've noticed significant performance increases since doing, not to mention that I've freed up some space on other, more important drives.
Good luck!
Swap: Don't boot XP without it (Score:3, Interesting)
A RAMdrive from system memory: Under $100 [cenatek.com]
A solid state disk drive you shove into a PCI slot with a bunch of SDRAM on it: Priceless [cenatek.com]
For everything else, there's, Hey! Why would I pay more than a grand for a PCI bandwidth capped solid state drive when I can fill my memory slots and use RAMDrive at DDR bandwidth?
Putting swap in a RAM disk makes no sense (Score:4, Informative)
Re:Putting swap in a RAM disk makes no sense (Score:3, Informative)
RAM disks are fast, Windows requires swap no matter your physical RAM size, so why not put it on a RAM disk?
What are us dummies missing mlq? Please elaborate.
Re:Putting swap in a RAM disk makes no sense (Score:2)
What, then does this have to do with putting the swap file in a RAM disk? Simple - a swap file is hard drive space masquerading as RAM, and a RAM drive is RAM masquerading as a hard drive. You end up going in a circle. The net performance gain in the best case would be zero, and in the real world will be negative due to overhead. You would be much better off simply specifiying to Windows to use no swap space at all; of course, this can be dangerous if you don't have more RAM than you'll ever use.
Re:Putting swap in a RAM disk makes no sense (Score:2)
That's the whole crux of my original post. You ever try that? I already understand everything you're saying and it falls severely short of the truth on a windows box.
No matter how much main memory your system boasts, Windows XP still creates and uses a page file for virtual memory... If you have a large amount of RAM (at least 1 GB), you might think that Windows XP would never need virtual memory, so that it would be okay to turn off the page file. This won't work, however, because Windows XP needs the page file anyway and some programs may crash if no virtual memory is present. [microsoft.com]
How aggravating. Anyway, there are many people today who have windows with "more ram than they'll ever need". Since Windows is too stubborn to run w/o swap, I say throw it back into RAM where it belongs in the first place. Heck, isn't that part of why you bought the ram? 1 gig of 400MHz DDR and the only time I can get XP to use more than 650M or so is when gaming. Meanwhile that page file is still there, thrashing occasionally.
Re:Putting swap in a RAM disk makes no sense (Score:2)
But it won't work properly. Windows will try to swap out the ramdisk onto itself. In the end all that will happen is that the swap file will be full of many copies of itself. Better to have a swapfile on disk that is rarely used. I would surprised if Windows will even let you set the swapfile to be on a ram disk.
Re:Putting swap in a RAM disk makes no sense (Score:2)
Because it's a waste. The more RAM you have, the less swap you need.
Re:Putting swap in a RAM disk makes no sense (Score:2)
>it only uses the swap space actively if you run out of RAM.
Should be true. Isn't though. Just watch the Perf Mon.
[time passes...]
Ok, I just spent an hour reading/googling up on this. Apparently the MS link I give above is highly disputed. XP has an option for no-page-file, but MS says it'll make one anyway. But people who have done this can only find the evidence in the Perf monitor. No file anywhere. The mess doesn't stop there.
Apparently there is much hullabaloo about what actually happens with a W2K/XP page file. My newly acquired lack of understanding here leaves me
Apparently that's not far from where I started.
Re:Swap: Don't boot XP without it (Score:2)
I went into sticker shock when I saw the 1-gig RocketDrive PCI card was $1,000. But then I got to thinking about it: It would cost me $500 to go from 1 gig of RAM to 2. (I have to throw out the old RAM...) Assuming it behaves better than my hard drive (well it should.. I mean it won't be as fast as the main memory but it should kick the drive's butt...) I could set the swap drive to it and get much better performance while I'm rendering. Then, if I get a new machine where I max out the RAM, I can slap the card in and still have an extra gig.... Yeah, I see what you mean by 'priceless'.
Sorry to babble. I'm sitting here waiting for my computer to render. It's swapping about 500 megs in. Ugh.
Re:Swap: Don't boot XP without it (Score:2)
Re:Swap: Don't boot XP without it (Score:2)
LK
no sense in that (Score:3, Insightful)
Second, transfer rates have increased about ten-fold since that drive was manufactured. (Access times haven't.) While it is ideal to have swap space on its own spindle and controller, it doesn't make much sense to optimize details like that but use such a slow disk.
Just make a swap file on your system disk and forget about it. If the rest of the machine is new, it should have enough physical memory that swap is mostly irrelevant.
Absolutely!!!! (Score:3, Informative)
Swapping on a separate drive is faster than swapping on the same drive. I've tested that. I also put the "temp" directories on the separate drive, as well as the data directories for my applications. This includeds the mailbox for Outlook Express and the temporary internet files for Internet Explorer.
There's a big bonus to setting up like this, besides performance. There's less to backup from C: drive!
[Contrary to popular belief, not all nerds and geeks use OSS.]
Re:Absolutely!!!! (Score:2)
For Solaris 8 and 9, at least,
Re:Absolutely!!!! (Score:2)
That advice goes back to the days of Win 3.1, probably even further back, and it's bullshit. Any "guru" who makes such a blanked suggestion is talking out of his ass. He read it once ten years ago and is just parroting it.
The point of having so much RAM is so that you don't need as much virtual memory. I have 512 MB in my current machine, it would be idiocy to use 1.25 GB of my HD for swap that I don't need. If I was running bigger programs, or needed to run more programs at once, I'd buy more RAM.
Currently I'm letting Windows handle the swap on its own, it has allocated 768 MB for my swap. The task manager shows that I'm currently using 167 MB of that swap file.
I couldn't agree more with the benefits of swapping to a different drive, but as for the swap/page/virtual memory. Don't believe the hype.
LK
Re:Absolutely!!!! (Score:2)
This is an attempt at humor, right?
Depends. Do users skip pagefile.sys when backing up? If so, yes.
two drives and 1 controller, with striped swap. (Score:2, Informative)
Like you I'm also not sure if it makes much difference but my system certainly seems to often be swap limited. I currently have KDE3, several gnome apps, a browsers with 4 windows (20+tabs), 2 virtual desktops, and I often use octave to process high resolution images. Changing from one app to another can cause the machine to swap for a few seconds if I've haven't used the first app in a few hours/days.
Elivs
Clearly if I used windows I wouldn't have these problems as I could never leave apps idle for days while doing another task.
/me Ducks as an "MS wireless mouse" flies towards me...
Re:two drives and 1 controller, with striped swap. (Score:2)
If you had one drive on one controller, the other drive on a different controller (or if you were using SCSI) and you will see gains.
That said, if your system seems swap limited watch the memory utilization - if your system has 512M and it is using all 512M of it, add more RAM for better performance (disclaimer - I have no clue whether or not your OS will use more than 512M but if it does, go for it.)
Good news in you are looking at going to Windows - starting with Windows 2003 they are 'seeing crazy uptime numbers now, like three months' [microsoft.com].
The HD sounds like a good idea (Score:5, Insightful)
Finally, remember that idealy, you never want to hit swap at all. If you're experiencing problems with thrashing, you should probably either pare down your system (do you really need to run that IM program all the time? all those systray utilities you never use?) or simply bite the bullet and get more RAM. Even the fastest hard drive can't touch RAM for speed, and seeing your system hit the pagefile for routine tasks means it's time to put a new stick of RAM into the beast.
Re:The HD sounds like a good idea (Score:2)
good god I am fu@#ed... I'm about to start working on 3000 x 3000 res video..... any sugeestions on what kinda system i should buy to do the editing?
Not enough data. (Score:2)
If you really hit your swap hard, then I guess installing a dedicated swap drive would make sense. Of course, so would upgrading your RAM, which would have a much more positive impact on your system's performance, and without the additional heat, noise, and power consumption that adding another drive would.
As another poster mentioned, the rule of thumb is to have twice as much swap as physical ram. Personally, I think that's outmoded, and I don't see the point in even having a swap partition equal in size to a system's physical ram. I have 512mb in my desktop box, and I rarely hit my swap. Right now, I'm running a slew of apps, and I've only hit 5mb of swap.
In short, it may be an interesting exercise, but it's probably not worth it.
Of *course* it's worth it! (Score:2)
Just remember, you have all your time to avoid the slashdot effect, so you better have mirrors, boy. There ain't no excuse!
Yes. (Score:2)
Yes.
Multiple swap partitions on multiple drives (Score:2)
One Word Answer: No (Score:5, Informative)
If the drive is 2GB, then don't be so sure that it is fast - it may have been when it was bought, but that was 6 or so years ago at least. I would be very suprised indeed to see more than 4-5MB/s sustained read and 2-3 write; there have been a lot of advances in the last few years.
My current setup (1GB physical RAM) has 2GB set aside for each of Win2k and Linux in seperate partitions right in the middle (this will speed up average access times as the heads will have the least far to travel on average from any random point over the platters) of the raid array (and hench middle of both disks, as it is RAID-0), which I know to be fast - benchmarking has pegged it at greater than 110MB/s sustained. Windows will hit the swapfile no matter what (just try setting the swap to 0, even on a well-heeled system, and watch it complain at bootup/logon), so it gets 512MB to play with just at bootup and can go all the way to the end of it's swap partition if it wants. Linux, well, that's another story (currently support for the raid array is patchy, so not running linux - the partitions are still there, though, waiting for filsystems!), but as everybody knows, linux is very aggressive about swapping stuff out and using physical RAM as a disk cache, so again I expect it to hit the swapfile after a few days (hours?) running, but be perfectly happy with 2GB.
Performance considerations (Score:2, Informative)
Check the performance specs for that 2gig drive first. If you are connecting an older, slower drive, you may actually worsen performance. For best performance, use a drive that can supports whatever performance features your mobo offers ( UDMA-66, Serial ATA, etc... )
IF using Windows 2000/XP you can spread your page file accross multiple hard drives.
Yes, definitely (Score:2, Insightful)
Real world experience - Rally Championship 2000 - swap file on the same drive as the game - loading times were long - 30 seconds or more. The indicator bar would move for a bit, stop for a bit, move for a bit, stop for a bit...
Change the swap file to the other drive and the level loading time went away. 18 seconds.
And the progress indicator keeps moving all the way with no pauses.
Think of it as the difference between having to do everything one handed (read this bit off the drive, track all the way across the platter to the swap file, write that bit there, track all the way back across the platter for the nexct bit of reading, etc, etc, etc), and having two hands (read with the right, write with the left)
Re:Yes, definitely (Score:2)
The last time I had a game use swap was Warcraft III on a 256-meg machine, and saw slowdowns like the one you mentioned. Rather than put swap on another drive, I stuck another DIMM in the machine, and the problem was solved. : )
steve
What I've always heard.. (Score:2)
If you're running Windows NT/2000/XP, make the partition in question NTFS too.
I'm running XP Pro with 512MB of PC2100 and have my swap start/stop at 2GB (ok, 4x my RAM) on an NTFS partition. The little trashing I do have is because that partition also contains game files and downloads from bittorrent.
I imagine if you're using a 2GB drive solely for swap and nothing else, you may not have any thrashing at all.
How reliable is that 2GB drive though? I guess it doesn't really matter, cause if the drive fails, the OS should move the swapfile back to the default location.
Re:What I've always heard.. (Score:2)
Why? NTFS is slower than FAT, offsetting the gains you might have made by your other tweaks. If you're worried about someone being able to read what's on the partition easily, well, they still can if it's NTFS.
How reliable is that 2GB drive though? I guess it doesn't really matter, cause if the drive fails, the OS should move the swapfile back to the default location.
If the drive fails, you've just experienced roughly the same thing as if you'd pulled a stick of memory out of your computer while it was running.
steve
Re:What I've always heard.. (Score:2)
Slower how? In accessing files? This is just for the pagefile. And NTFS is better as far as fragmentation goes - less fragmentation with NTFS than FAT or FAT32.
do nothing (Score:2)
So you don't need to do anything. Leave it alone. You're not going to notice an ounce of difference. All you'll be getting is the extra noise and heat of another hard drive, which will be rarely, if ever, be getting accessed. No need to do it.
There's no pat answer... (Score:2, Insightful)
Depends on your PC and what you do with it. Putting the swapfile on the outside edge of the fastest disk that does *not* have Windows on it is generally the best idea. If you're concerned about dissimilar PIO or UDMA transfer rates, if your IDE controller supports multiple media transfer rates (most IDE controllers built after about 1998 do) you don't have anything to worry about. There's no reason I can think of to have multiple pagefiles on a Windows machine unless it's a server or you're heavily into A/V.
Re size of the paging file: A static swapfile is always going to perform better than a dynamic one - provided the static file is big enough. Here's whatcha do -
Use Performance Monitor to measure swapfile use over a week or two. You'll be able to tell exactly how much paging file you need from that. Take a couple hundred MB onto that number just for grins and make it a static pagefile.
Paging to disk is always slower than using real memory - but some applications (one of them being Internet Explorer) *require* a swapfile. My XP box is a dual processor 1GHz machine with 384mb of memory. It's usually just used for surfing the web and a bit of word processing, but I've never seen more than about 10% of its 768mb static pagefile in use.
Hope this helps -
change the partition type, too. (Score:2)
but if you're dealing with xp, you can also gain some speed by NOT using ntfs on that drive. instead, use fat32- your swap file is not a file that needs full ntfs (permission or security or compression or encryption) complexity.
combine that with a fixed size, from the word go, and you can get very nice speed bumps.
If you gotta (Score:2)
Re:Some suggest that... (Score:2)
Yes.
Re:Some suggest that... (Score:2)
Re:Some suggest that... (Score:2)
Kinda like SCO assuming IBM had to buy all them 2.4 goodness...
Gotta remember they have vested interest in linux not being as good as it can be, makes them look good.
Re:If it's more of a worry than (Score:2)
He will use $7.55 of electricity for an entire year. I don't think that will break him.
Re:If it's more of a worry than (Score:2)
Don't people get it yet? It's about cumulative effects. It's harder to get someone to give you a hundred dollars than it is to get a hundred people to give you a dollar. Even the homeless can figure that out. Whether it's snowballing costs from electricity or snowballing energy waste by a hundred-thousand people blowing through 8.76 million kWh in a year, it's a cumulative effect that's 1) taking more money from the poor to give to the rich and 2) taking more energy than can be sustainably supplied.
People complain about the planet and the system and all sorts of other things a lot but never do anything about it. The most common complaint is "it's too hard to do anything about it" followed by "what can one person do?" Give me a fucking break: it's the LITTLE things that matter, like not stuffing a 2 GB hard drive in your system (which has the worst energy to size ratio you can get for modern drives) that you don't need.
Re:If it's more of a worry than (Score:2)
And you sound like a green idiot.
If you want to reduce power consumption, you start with the big things--refrigerators, driers, air conditioners, stoves. You don't start with a 10 W hard drive.
Re:If it's more of a worry than (Score:2)
If you had bothered to read what I said, you would have noticed that I specifically pointed out that people aren't willing to do "big" things, like give up their refrigerators, washing machines and air conditioners.
It's like I said, it's easier to get a dollar from a hundred people than a hundred dollars from one person. It's easier to get ten watts out of a hundred people than a thousand watts out of one person.
Re:If it's more of a worry than (Score:2)
Re:Fast Access (Score:2)
(Now if you were using a redundant form of RAID, that's a different story. No operating system likes having the swap pulled out from under it, so keeping it alive through a disk failure is a good thing.)
steve
Re:Fast Access (Score:2)
Swap is a necessary evil, optimizing it is in everyone's interest.
Re:Fast Access (Score:2)
Remembering, of course, that RAID will actually make your random seek times *worse* (or, best/rarest case, no better), probably offsetting that increase in throughput.
Re:Windows Swap (Score:2)
If you're talking about Windows 9x, then early and excessive swapping had another cause.
The memory manager for Windows 9x tries to take the same philosophy as Unix - use all available memory for disk cache, and release it as necessary. The only problem was that it would not release it willingly enough.
If you watch the memory, swap, and cache usage, you'd see that it would use so much for disk cache that swapping would occur early. Theoretically, that swapped out data could also be in the disk cache, but behavioral observation indicated that it probably wasn't.
On every win9x machine I've seen, used, fixed, or tweaked, limitting the disk cache size to a more reasonable figure GREATLY improved the performance through reducing (or eliminating) swapping.
Luckily, NT/2K/XP aren't quite as bad in that regard.
steve