I wish I could just buy more RAM every time I hit a memory constraint.
EDIT: There’s a more general performance reason for using swap at the default settings (doesn’t cover every case but is fine for lots of situations). At the default settings it will start actively swapping at about 40% memory used. This is because the system actively benefits from the fs cache mentioned in the article and performance suffers in low-memory conditions due to the fs cache not having free RAM to work with. You’re waiting more on I/O (which has a big performance hit even with fast storage) as opposed to getting files from the cache. As RAM use increases, you can swap some of the less-needed program code to disk to keep more free space available for the disk cache. The default swappiness parameter might not be optimal for your computer/RAM use patterns and you might need to do some experimenting to find optimal values, but overall some amount of swapping is probably a good idea
I’ve heard that argument and i understand the technical reasoning, but in real-world experience i found that disabling swap was the best swappiness for me. Maybe i’m doing something wrong but “help my computer freezes sometime” is a common problem in my circles and “disable swap” has been the best recommendation i found so far.
I wish I could just buy more RAM every time I hit a memory constraint.
EDIT: There’s a more general performance reason for using swap at the default settings (doesn’t cover every case but is fine for lots of situations). At the default settings it will start actively swapping at about 40% memory used. This is because the system actively benefits from the fs cache mentioned in the article and performance suffers in low-memory conditions due to the fs cache not having free RAM to work with. You’re waiting more on I/O (which has a big performance hit even with fast storage) as opposed to getting files from the cache. As RAM use increases, you can swap some of the less-needed program code to disk to keep more free space available for the disk cache. The default swappiness parameter might not be optimal for your computer/RAM use patterns and you might need to do some experimenting to find optimal values, but overall some amount of swapping is probably a good idea
I’ve heard that argument and i understand the technical reasoning, but in real-world experience i found that disabling swap was the best swappiness for me. Maybe i’m doing something wrong but “help my computer freezes sometime” is a common problem in my circles and “disable swap” has been the best recommendation i found so far.
I find that degraded performance is pretty much always preferable to playing Russian roulette with system processes.