3 ms·
This is an area where everyone's anecdotal evidence is different, because people are running all sorts of different workloads on all sorts of different RAM/swap
by kijin 5y ago
This is an area where everyone's anecdotal evidence is different, because people are running all sorts of different workloads on all sorts of different RAM/swap/disk configurations.
Naturally, some people will have had consistently positive experiences with swap, while others will have come out with consistently negative impressions. 32GB RAM + 512MB swap backed by a fast SSD is very different from 2GB RAM + 512MB swap backed by spinning rust. JVM is different from MySQL, which again uses memory differently than PostgreSQL.
And yet we are so eager to hurl sweeping generalizations at each other, holding religiously onto our own subjective cargo cults. :(
- mhitza 5y agoFor Linux on desktop, my experience with swap used to be extremely bad before systemd-oomd. I got those system lockups easily in various workloads that for the longest time I went without swap, and a crashing program was a better experience. On the server, sprinkling in a bit of swap was standard practice in some orgs. As under load I could still log into a slow server and do something about it. My current problem with swap in Linux is that they make bad default choices. While a swapfile isn't optimal, allocating a slice of the disk for swap complicates my life when I do ram upgrades. Hibernate being tied to configured swap on a slice of disk (ugh), I just didn't even bother with it since upgrading ram.
- pmontra 5y agoYou are right. My own anecdotal experience: Rails, Django, Elixir/Phoenix web development, sometimes with docker. No swap on my 32 GB laptop both when I used it with a 750 GB HDD in its early years and with two 1 TB SSDs now. I'm usually using about 20 GB RAM because I'm leaving every single project open in its own virtual desktop, to get there quickly if a customer needs something done. No problem whatsoever that I remember. I'm never close to filling up RAM, that could be the reason. I'd buy extra RAM instead of enabling swap. The price would be extra battery depletion during the night.