3 ms·
I don't create swap space on servers anymore. If I run out of RAM, I'm likely dealing with something that's out of control and I'm going to run out of swap also
by throwawayboise 5y ago
I don't create swap space on servers anymore. If I run out of RAM, I'm likely dealing with something that's out of control and I'm going to run out of swap also, it just delays the inevitable.
- toast0 5y agoA small (512 MB) swap partition gives you enough runway to warn on 25% use, alert on 50% use, and address some problems without the fun of abrupt shutdowns when allocations fail (or the OOM killer shows up). Monitoring for high swap I/O makes some sense, but 512 MB fills up fast, so chances are it'll fill up before anyone can respond to an alert in that case. At least in my experience, it's pretty hard to actually gauge memory use, but swap use makes a reasonable gauge most of the time. There are certainly many use cases where the swap use ends up not being a useful gauge though.
- Johnny555 5y agoAll of the servers I manage now are cloud servers, and swapping to attached storage is slow. I don't really want random processes killed by the OOM killer, leaving the server in an unknown state... so I set the servers to panic on OOM.
- lathiat 5y agoIts been a bit of a complicated problem but memory pressure metrics are now a thing: https://facebookmicrosites.github.io/cgroup2/docs/pressure-metrics.html https://facebookmicrosites.github.io/cgroup2/docs/pressure-m...