vote up 15 vote down star
3

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.

flag

55% accept rate

9 Answers

vote up 9 vote down check

We recommend disabling page file because of the potential impact that the page file has on the flash storage device lifetime.

Source: Microsoft Guidelines (PDF, p.9)

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.

link|flag
1  
Odd. Last time I suggested SSDs have limited lifetimes compared to regular HDDs (for the same usage), I got downvoted. – Manos Dilaverakis Oct 6 at 15:17
well, in this case i'm just the messenger, and they don't get shot anymore :) however, an accurate answer would pretty much depend on the specifications of the SSD which we don't know, quite possible that paging would perform better on a platter hard drive with a big cache memory. – Molly Oct 6 at 15:22
The quote is incomplete. The recommendation is for a 2 GB device. In that case pagefile would occupy a significant percentage of drive greatly reducing free space and increasing wear of individual cells. A 64 GB drive has more cells to distribute this wear over. I guess SSD manufacturer's recommendations would be more useful. If swap is seldom used it shouldn't cause much wear but an SSD could really help at those rare times when swapping suddenly causes insufferable slowness. – Bender Oct 6 at 18:50
3  
does paging have an impact on the lifespan of SSDs? yes, but so does ANY write operation. do i care? hell, no! if the bleedin' thing goes down after 3, 4 or 5 years, so what? by then we will see SSDs 10 times faster than today's technology and it's time to move on anyway. or do you much care for a 5 year old 5400 RPM HDD with maybe 80 GB capacity? i rather doubt it :) – Molly Oct 6 at 19:37
Current Gen SSDs have lifetimes not only comparable to HDDs, but often surpassing their "actual" lifetimes - as in, not the factory tested perfect conditions lifetimes. No moving parts is a boon to longetivity. – Phoshi Oct 26 at 1:00
show 2 more comments
vote up 5 vote down

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.

link|flag
1  
Good answer. :) – musicfreak Oct 26 at 1:08
vote up 5 vote down

Please check out this article.

http://www.storagesearch.com/ssdmyths-endurance.html

51 Years!!!

I don't think I deserved all the down votes, but I guess you can always vote this down Best regards.

link|flag
I remember they used to say cd's are going to last on average 30 years, when they were introduced. Now this ... but looking at history, every new generation of storage media lasts less and less ... I'll stick with old HDD's for now. They seem to last pretty long. As far as SSD's go, I look forward to hearing from you and will gladly buy you a drink in 51 years (bring that ssd with you :) (no downvote). – ldigas Oct 8 at 0:22
Its a date! What town do you live in? – Xavierjazz Oct 8 at 1:16
I do believe the rumors of SSDs wearing out so quickly are exaggerated, but 51 years seems a bit of a stretch... Plus, it's largely theoretical at this point because SSDs are so new. I'd wait a few years until more info comes out about this before even getting an SSD, let along putting my pagefile on one. – musicfreak Oct 26 at 1:07
vote up 0 vote down

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.

link|flag
vote up 0 vote down

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.

link|flag
2  
Well, if you're not using swap a lot, you won't benefit much from the speed too, so I would prefer leaving the swap in a traditional HD, for wear and space reasons. – Martinho Fernandes Oct 6 at 14:47
This is true. I guess I hadn't thought of it that way. – Patrick Regan Oct 6 at 14:56
vote up 0 vote down

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.

link|flag
3  
Without knowing the detail of the write-wear algorithms, you can't know that a larger partition will help. I was under the impression the write-wear algorithms worked at the page level, regardless of partitioning since the SSD is random-access. The whole point of those algorithms is to avoid excessive wear so why wouldn't they use the whole drive to spread the writes, even for small partitions? – Ben S Oct 6 at 15:03
fair point. i was assuming the spread would be limited to within partitions. i guess the counterpoint would be that maintaining a list of what-page-is-where would get too out of hand if you didn't do some limiting, but we really don't know. – ~quack Oct 6 at 15:15
vote up 0 vote down

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.

link|flag
vote up 0 vote down

http://www.storagesearch.com/ssd-buyers-guide.html

This should provide accurate info.

link|flag
vote up -6 vote down

A solid state device has no moving parts, so wear is not an issue as it is with older devices.

link|flag
1  
Actually current SSD drives have a limited number of writes. They do wear out. – Martinho Fernandes Oct 6 at 14:41
2  
from wikipedia: Flash-memory cells have limited lifetimes and will often wear out after 1,000 to 10,000 write cycles for MLC, and up to 100,000 write cycles for SLC. – Martinho Fernandes Oct 6 at 14:41
Thanks. xxxxxxxxxxxxxxxxxxxxxxxxxxxx – Xavierjazz Oct 6 at 19:09

Your Answer

Get an OpenID
or
never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.