I'm considering getting an SSD drive to run as the primary OS partition. As I understand, this should provide a substantial improvement in performance. My question is this: Should I leave the swap file on that drive? The swap partition will be largely random seeks and so should benefit from the speed. On the other hand, it will be constantly written to which will wear out the drive faster.
|
If possible, you might want to use a secondary platter hard drive as location for virtual memory. If you don't have one, it's still recommended to have a page file but you might want to disable it for extra disk space. It's all up to you whether decrease memory load or more disk space is important... |
|||||||||||||||||||||
|
|
From MSDN Blogs > Engineering Windows 7 > Support and Q&A for Solid-State Drives:
|
|||
|
|
I have a better answer: Why, when you can just buy more RAM? RAM is as cheap or cheaper than SSD space. It's also much faster, and it will never (well, almost never) degrade like SSD drives do. Swapping memory to disk is a symptom of not enough RAM. If you need to speed up swapping, don't speed up the swap disk, upgrade your RAM and the swapping will go away. Swapping should be considered a last-resort backup plan anyway. |
|||||||||||||||
|
|
Here is some S.M.A.R.T data from a OCZ-AGILITY SSD that I have used in a linux laptop for around two years. I have a swap partition on the disk, and the only "tweak" I've made is to set swappiness = 0 in linux. Windows swap profile is more or less like linux swappiness = 0. It's my personal laptop, so it's not used 8 hours a day (more like 1.5 hours), but I do quite a lot of development on it so there is a lot of file creation going on.
The interesting parts are:
So... I think it's safe to assume that the disk should last until I retire it of other reasons. (*touch wood) It's already too small... Assuming the numbers scale, 40 hour/week would give a life time of at least 3-4 years - probably more, since i suspect I am more efficient at wearing out my disk at home... Less meetings... So, I think its quite ok for a work machine, given the benefits.
So, my advice is: Get rid of the noisy mechanical drives and enjoy the silence :-) It's awesome with an absolutely quiet laptop. |
|||||
|
|
A lot of people are saying "don't swap if you can help it", but this is misleading, at least for Windows (and probably for Linux too). Windows, esp. recent versions, will always try to fill up RAM with cached data that it thinks is going to be needed quickly, and will deliberately swap other stuff to disk. It does this irrespective of how much RAM you have. I have 4GB, only half in use, but swapping still happens. Disabling swapping is a bad idea too, because some programs can require huge amounts of memory reserved for them (think Photoshop), and you can easily get out of memory messages. It depends on usage, but swapping is always useful to have for extreme situations. So SSDs are not a replacement for RAM (saying "get more RAM" is missing the point) but a possibly faster alternative to virtual memory on hard disks. Take a look at this review to see how SSDs can leave mechanical hard drives in the dust: "Hard-Drive Roundup June 2010" Also remember it's the IOPS figure that's far more important than the transfer rate. Another thing to consider is whether your current swap drive is also your main drive. For most people, the answer will be yes. That means the hard drive is having to access paged virtual memory whilst also accessing data and programs. In this case, having an SSD for paging is likely to make a noticeable improvement. I'm looking for somebody who's tried this to give definitive info on performance, but on paper the case looks clear-cut. |
||||
|
|
|
Patrick Regan's answer about "swappiness" is pretty spot on: depending on your usage, it might be fine, and if you're using Linux you can tweak "vm.swappiness" in sysctl (as described in an earlier question) for your use. So I'm tempted to say yes, as long as you give lots of disk to your swap. I've been hearing lots about the internal controllers on SSDs having super-tweaked algorithms to combat write wear, so in theory this would help -- give it lots of space, and set the kernel swappiness level low, and the SSD controller can spread the writes out and prevent any wear trouble. So that got me to wondering what the largest swap partition could be. I locked onto your mention of "swap partition" and thought "linux", so I looked into the maximums there. Turns out you can create ridiculous things like 16TB swap partitions, at least based on the kernel math. mkswap might not be able to actually initialize that partition, but the kernel supports it. However, the kernel can't use it. According to this, 16GB is about the biggest swap partition you can make and use in a modern linux kernel. So yes, you can, if your usage is going to be fairly swap-free. If you'll be swap-heavy, though, maybe a cheapo USB key for ReadyBoost (or the Unix equivalent) would be a better fit -- that way when your swapping destroys the device from overwriting, it'll be cheap to replace and won't cost you the price of another SSD. |
|||||||
|
|
Unless you need the swap file (for suspend to disk for example), I would simply turn swapping off and get rid of your swap partition. The point of swap is to provide an extra cache level. Since your SSD has a low latency, the gains of using swap are much lower. If your system hardly ever swaps, then it makes even more sense to just get rid of it. I've been running a few linux boxes without any swap for a few years now (on regular HDDs) without performance issues. Any box with > 2GB of RAM I just don't bother with swap. |
|||
|
|
|
Although the random read of SSD drives is very good, the random write performance can be very bad. Apparently some SSDs only provide 12 write IOPS, which is only a tenth of what a standard rotational disk provides(~120IOPS), and even faster SSDs like the Super Talent SSD may only provide 50 random write IOPS. On the other hand it is possible for an SSD to perform thousands of operations per second, for example the Intel X25-M 160GB 34nm MLC G2 can perform 8600 (1) (according to the intel spec sheet) or even 15334 (2) random write IOPS of 4k blocks. So in conclusion the swap performance of your SSD may well be better, but do not assume that this will be the case until you have checked the number of random write IOPS your SSD can achieve. (1): download.intel.com/design/flash/nand/mainstream/322208.pdf (2): www.legitreviews.com/article/1022/6/ |
|||||
|
|
I would be inclined to say that the performance gain from it is not worth it, especially if you have a lot of RAM. If you have at least 2GB RAM, you probably won't page a ton anyway so the benefits would be minimal. Not to mention that SSD sizes are relatively small, so you may not want to eat up a few GB worth of pagefile on it anyway. |
|||
|
|
|
I think it would depend on how much RAM you have and how your "swappiness" is set. I have a swap set up on my computers, but if I don't hibernate, I rarely write to it. I tend to not max out my RAM usage. But if you know you're hitting swap a lot, I'd say no. If you don't hit it a lot, I'd say go for it. |
|||||||
|
|
FWIW: I've been using my pagefile.sys on my Intel SSD, for 10 months continuously. Don't know about Win Vista or newer, but on Win XP turning OFF the pagefile seems like a really bad idea. Windows must thrash on something, so thrashing on a SSD is much better than thrashing on a traditional HD ;-) If this actually decreases the lifespan of the SSD, so what. I'll be buying larger ones probably once / year as the prices continually drop. At this exact moment in time, you get about $2 / GB. |
|||
|
|
non-pagedandpagedpool memory sections. A page file is necessary for when the paged section gets full, as a gamer I have seen a game complain about paged pool memory just because I had my page file disabled on a 8 GB system. Conclusion: Page files are necessary, they prevent paged pool depletion and actually do speed up your system. – Tom Wijsman Oct 24 '11 at 16:32