4 ms·
Swap makes a lot of sense for a consumer device, where I'm opening a big spreadsheet, then putting that in background to edit this video. It makes less sense f
by paulddraper 10y ago
Swap makes a lot of sense for a consumer device, where I'm opening a big spreadsheet, then putting that in background to edit this video.
It makes less sense for server workloads, where you usually don't have huge chunks of inactive memory.
I always run with no swap in AWS, especially with the newer EBS-only families.
- dotancohen 10y agoEBS is a problem because in reality you would be swapping to a network volume. But on a standard VPS server, a bit of swap can really save you some problems. Swap was invented at a time when *NIX was strictly used in a multi-user environment, not far removed from today's webservers but very different from today's consumer devices. It still serves a purpose in that role.
- eikenberry 10y ago> [...] a bit of swap can really save you some problems. And cause a bunch more. Have you ever had to debug a race that is only triggered when a process hits swap. Not fun at all.
- sscarduzio 10y agoYes I did, and the swappy machine started responding just a tad too slowly to other nodes' pings, engaging into a loop of join/parting the cluster, causing replication to kick in all the time and a whole "highly available" critical cluster of 9 nodes was unable to handle traffic (too busy replicating) causing millions in losses. So yeah, don't use swap in servers. Ironically, if the node had crashed for OoM, the cluster would have survived just fine.