4 ms·
I wondered this for a while, unfortunately a major question I have remains unanswered in the text: What about SSDs and SSD-only systems? (Like... any average la
by hannob 9y ago
I wondered this for a while, unfortunately a major question I have remains unanswered in the text: What about SSDs and SSD-only systems? (Like... any average laptop.) Should I be worried that putting a swap on an SSD will cause it to wear out fast due to many write cycles?
- ktpsns 9y agoSame here. How does file swap (cf. https://wiki.archlinux.org/index.php/swap#Swap_file_creation https://wiki.archlinux.org/index.php/swap#Swap_file_creation) could help out to let an underlying file system distribute the usage of the ssd? Combined with recreating a swap file on every boot (say on a frequently booting desktop machine), this could make a difference.
- INTPenis 9y agoI set vm.swappiness to 0 on my Fedora laptop. Meaning the kernel will only swap to save the system. I've been doing this for years and had no issues. Edit: Actually in recent kernels, which I am using, 0 means it's disabled. I was thinking of 1.
- AstralStorm 9y agoIt does not help, just makes the problem appear later in a more dire way. Try overcommit settings instead.
- INTPenis 9y agoI googled that and was pleasantly surprised to learn something new.[1] But if I'm reading that right I would probably want to do both. Because overcommit settings seem to be a memory saving technique. To avoid needing swap by decreasing the allowed overcommit memory. Anyways, in the many years that I've been changing vm.swappiness I've never had any issues and I've always had a minimum of 8G RAM so I don't think this will be a big issue. 1. http://engineering.pivotal.io/post/virtual_memory_settings_in_linux_-_the_problem_with_overcommit/ http://engineering.pivotal.io/post/virtual_memory_settings_i...
- sevensor 9y agoI used to work in flash manufacturing. We would joke, "I hope nobody ever uses this for swap!" The numbers I saw for endurance (basically write-erase cycles before failure) were not encouraging at all. As far as I can tell the only reason MLC flash works at all is that the controller does some magic to present a whole bunch of pretty flaky cells as a single reliable unit.
- Dylan16807 9y ago> As far as I can tell the only reason MLC flash works at all is that the controller does some magic to present a whole bunch of pretty flaky cells as a single reliable unit. I would refuse to even use SLC flash without that magic. But once you have all that ECC and balancing, durability almost stops being a problem outside of heavy database loads.
- warrenm 9y ago>I used to work in flash manufacturing How long ago? r/w cycles haven't really been an issue on SSDs in a long time
- sevensor 9y ago2010. I've been following the industry since I left, and I promise you neither the physics of FN flash nor the manufacturing process has fundamentally changed since then. Nor have the true endurance numbers substantially improved. If anything the situation is worse now with smaller device dimensions. The only thing standing between your collection of cat gifs and oblivion is the flash controller making intelligent guesses about what it just read.
- warrenm 9y agoSorry, but you must not be "following the industry" very well. SSDs have lifespans measured in years of constant use. If you think it isn't the case, you need to go back and learn more about those devices you claim to know so much about.
- dekhn 9y agoI've swapped hundreds of terabytes to consumer SSDs. Haven't noticed any problems yet (visibly).
- warrenm 9y agoBy the time you start to see r/w issues on anything that resembles a modern SSD, you're probably wanting to replace the overall device anyway
- warrenm 9y agoNo. There is no worry putting swap on SSD. Given the choice, you should prefer swap on SSD (since it's so much faster than spinny disks). If swap on SSD was a bad idea, do you honestly think every laptop, desktop, and server manufacturer that uses exclusively SSD would still enable swap? Every mainstream OS wants/needs swap - it helps all of them
- cat199 9y ago> Should I be worried that putting a swap on an SSD will cause it to wear out fast due to many write cycles? This risk is hugely overstated for most use cases based on people having 'baggage' from 'dumb' flash memory cards. eMMC is another story (because these are basically 'dumb' flash memory cards) Recently read an article by samsung where they claim that 3d nand SSD drives can handle ~1x full drive write per day (e.g. 1TB drive -> 1TB/day) and still last the rated lifetime, and that v-nand can handle something like 5-10x (don't remember off hand precice figures, but it was easily googlable). Yes, this is a vendor figure - but should be at least ballpark accurate I'd think. Also, many SMART-capable drives show their estimated write cycle lifetime in SMART status (again, vendor figure, but still) .. if you check this on your laptop I bet you will be surprised at how low the figure is.