Should swappiness be lowered for SWAP partitions on SSD's?
by MirceaKitsune from LinuxQuestions.org on (#4W5AR)
As the results I found on this are inconclusive, I wanted to bring up the question here as well just to hear an extra opinion. I use an SSD for my root drive, with the SWAP partition being 4 GB large and the system having a total of 16 GB of RAM. Technically I don't even need SWAP with so much RAM, but just in case my RAM ever fills up I wanted to have a little safety margin. Although my SSD is a recent model and high quality MLC drive, I'm still on the lookout to avoid writing to it more than I need to, as to not wear out its relatively sensible lifespan. Although some openSUSE Tumbleweed snapshots can dump +1 GB of updates in one day (eg: game packages) my attention has been on SWAP as the default configuration causes it to be used very quickly.
The default swappiness is 60. What bothered me about it is that, whenever the system gets past roughly 6 GB of used memory, it begins filling the SWAP at once. With some software it can reach and stay at over 9 GB of RAM for a while, which in a few hours causes the SWAP to be filled up to 100 MB. This is pretty fast for barely exceeding half of my available RAM! As this makes rather nervous I decided to edit /etc/sysctl.conf and readd the commonly recommended vm.swappiness = 10 at the end.
Like I said I wanted to hear second thoughts just to know if this is the right approach: Do you believe the default swappiness of 60 is considered acceptable for SWAP partitions on SSD drives? Or do others agree that for an SSD a swappiness of 10 is better?


The default swappiness is 60. What bothered me about it is that, whenever the system gets past roughly 6 GB of used memory, it begins filling the SWAP at once. With some software it can reach and stay at over 9 GB of RAM for a while, which in a few hours causes the SWAP to be filled up to 100 MB. This is pretty fast for barely exceeding half of my available RAM! As this makes rather nervous I decided to edit /etc/sysctl.conf and readd the commonly recommended vm.swappiness = 10 at the end.
Like I said I wanted to hear second thoughts just to know if this is the right approach: Do you believe the default swappiness of 60 is considered acceptable for SWAP partitions on SSD drives? Or do others agree that for an SSD a swappiness of 10 is better?