3 ms·
> Try putting a consumer-grade SSD into a machine with 512 GiB RAM and let the kernel swap to it -- that SSD will be dead in a year. Are you sure? I’ve heard t
by codeflo 4y ago
> Try putting a consumer-grade SSD into a machine with 512 GiB RAM and let the kernel swap to it -- that SSD will be dead in a year.
Are you sure? I’ve heard the argument before that swap is one of the better cases for SSD longevity, because it’s few big writes instead of many tiny ones, and found that convincing. Also, on which workloads would a machine with that much RAM touch swap at all? My workstation has “only” 64 GiB, has swap configured (to enable suspend), even during heavy use with some databases running never touches it.
- marcosdumay 4y agoThe alternative of the large writes swap does is not a lot of smaller writes, it's no write at all. Also: > on which workloads would a machine with that much RAM touch swap at all On most of them? You seem to be using a flawed model of the Linux swapping algorithm. Writes aren't caused by lack of memory.
- codeflo 4y agoI know you're not the GP, but please give some specific examples of such workloads, I honestly want to know. To be clear, yes, it's well-known that the kernel will page out rarely used stuff, but those are (almost by definition) pages that are basically never written to. The claim was that writes to swap occur all the time, to the point where they wear out the SSD, that seems to be something different. At least I've never seen anything like that with any of my (workstation) workloads, like large C++ builds, TensorFlow experiments, or running lots of virtual machines. And that was only with 64 GiB RAM, not even the 512 GiB that the post I replied to mentioned.
- marcosdumay 4y agoThe kernel write the pages into swap long before it decides they are rarely used. Otherwise rewriting them would be way too slow to be of any use. Any normal use will fill some swap space, and if the memory pages keep getting dirty (and you have spare disk IO), your computer will keep writing them to swap. How much RAM you have is not really relevant.
- deleted 4y ago[deleted]