Should I keep my swap file on an SSD drive? - Super User most recent 30 from superuser.com2010-03-12T14:19:00Zhttp://superuser.com/feeds/question/51724http://www.creativecommons.org/licenses/by-nc/2.5/rdfhttp://superuser.com/questions/51724/should-i-keep-my-swap-file-on-an-ssd-drive16Should I keep my swap file on an SSD drive?Steve Rowehttp://superuser.com/users/21802009-10-06T14:33:42Z2009-10-26T00:56:28Z
<p>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.</p>
http://superuser.com/questions/51724/should-i-keep-my-swap-file-on-an-ssd-drive/51727#51727-6Answer by Xavierjazz for Should I keep my swap file on an SSD drive?Xavierjazzhttp://superuser.com/users/115462009-10-06T14:37:46Z2009-10-06T14:37:46Z<p>A solid state device has no moving parts, so wear is not an issue as it is with older devices.</p>
http://superuser.com/questions/51724/should-i-keep-my-swap-file-on-an-ssd-drive/51729#517299Answer by Molly7244 for Should I keep my swap file on an SSD drive?Molly7244http://superuser.com/users/02009-10-06T14:43:02Z2009-10-06T14:43:02Z<blockquote>
<p>We recommend disabling page file
because of the potential impact that
the page file has on the flash storage
device lifetime.</p>
</blockquote>
<p>Source: <a href="http://download.microsoft.com/download/2/0/a/20ac945c-34d0-4a60-8245-f80e80fe954f/GuidelinesForDesigningULCPCForWindowsXP-MSFT%20.pdf" rel="nofollow">Microsoft Guidelines</a> (PDF, p.9)</p>
<p>now, that is Microsoft's take on Windows with Solid State Disks, however, in a desktop PC, you might use a secondary platter hard drive as location for virtual memory.</p>
http://superuser.com/questions/51724/should-i-keep-my-swap-file-on-an-ssd-drive/51730#517300Answer by MarkM for Should I keep my swap file on an SSD drive?MarkMhttp://superuser.com/users/28552009-10-06T14:43:58Z2009-10-06T14:43:58Z<p>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.</p>
http://superuser.com/questions/51724/should-i-keep-my-swap-file-on-an-ssd-drive/51732#517320Answer by Patrick Regan for Should I keep my swap file on an SSD drive?Patrick Reganhttp://superuser.com/users/130592009-10-06T14:44:10Z2009-10-06T14:44:10Z<p>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.</p>
http://superuser.com/questions/51724/should-i-keep-my-swap-file-on-an-ssd-drive/51736#517360Answer by ~quack for Should I keep my swap file on an SSD drive?~quackhttp://superuser.com/users/127862009-10-06T14:56:56Z2009-10-06T14:56:56Z<p>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 <a href="http://superuser.com/questions/20984/releasing-swap-space/21005#21005">tweak "vm.swappiness" in sysctl</a> (as described in an earlier question) for your use.</p>
<p>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.</p>
<p>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.</p>
<p>Turns out you can create ridiculous things like 16TB swap partitions, at least based on the kernel math. <em>mkswap</em> might not be able to actually initialize that partition, but the kernel supports it. However, the kernel can't <em>use</em> it. <a href="http://lkml.indiana.edu/hypermail/linux/kernel/0905.3/02894.html" rel="nofollow">According to this</a>, 16GB is about the biggest swap partition you can make <em>and use</em> in a modern linux kernel.</p>
<p>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.</p>
http://superuser.com/questions/51724/should-i-keep-my-swap-file-on-an-ssd-drive/51743#517430Answer by Ben S for Should I keep my swap file on an SSD drive?Ben Shttp://superuser.com/users/90592009-10-06T15:05:10Z2009-10-06T15:05:10Z<p>Unless you <em>need</em> the swap file (for suspend to disk for example), I would simply turn swapping off and get rid of your swap partition. </p>
<p>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.</p>
<p>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.</p>
http://superuser.com/questions/51724/should-i-keep-my-swap-file-on-an-ssd-drive/51807#518075Answer by erniedwork for Should I keep my swap file on an SSD drive?erniedworkhttp://superuser.com/users/40162009-10-06T17:45:34Z2009-10-06T17:45:34Z<p>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 <em>much</em> faster, and it will never (well, almost never) degrade like SSD drives do. </p>
<p>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.</p>
http://superuser.com/questions/51724/should-i-keep-my-swap-file-on-an-ssd-drive/52517#525175Answer by Xavierjazz for Should I keep my swap file on an SSD drive?Xavierjazzhttp://superuser.com/users/115462009-10-07T23:19:13Z2009-10-07T23:19:13Z<p>Please check out this article.</p>
<p><a href="http://www.storagesearch.com/ssdmyths-endurance.html" rel="nofollow">http://www.storagesearch.com/ssdmyths-endurance.html</a></p>
<p><strong>51 Years!!!</strong></p>
<p>I don't think I deserved all the down votes, but I guess you can always vote this down
Best regards.</p>
http://superuser.com/questions/51724/should-i-keep-my-swap-file-on-an-ssd-drive/60616#606160Answer by Xavierjazz for Should I keep my swap file on an SSD drive?Xavierjazzhttp://superuser.com/users/115462009-10-26T00:56:28Z2009-10-26T00:56:28Z<p><a href="http://www.storagesearch.com/ssd-buyers-guide.html" rel="nofollow">http://www.storagesearch.com/ssd-buyers-guide.html</a></p>
<p>This should provide accurate info.</p>