This question already has an answer here:
- How do I configure swappiness? 1 answer
There are copious posts on disabling Ubuntu swap completely. Is it possible to tell Ubuntu to allow but discourage swap usage?
I've installed Xubuntu on a laptop with 1Gb ram and a small SSD, turning it into a Samba server. In a worst case scenario free memory still can fit all data from a swap file:
~$ free -m total used free shared buffers cached Mem: 991 696 294 17 66 175 -/+ buffers/cache: 454 536 Swap: 1952 107 1845
I want to discourage discourage swap when free memory is available, because swap does a lot of IO writes that degrade SSD quickly.
Is it possible to prioritize RAM over swap or the choice is limited to "swap on/off"? What side effects if any does it cause?
Thank you for pointing out existing answers they are relevant but hard to find. User must know 90% of the answer to search for "how to configure swappiness". Question answered. Hope this question header helps indexing.