3 ms·
The trick is not disabling swap, but having a reasonable size swap. The old rule of thumb of 2x RAM was reasonable in the 90s, but after that, it should be 2x R
by toast0 4y ago
The trick is not disabling swap, but having a reasonable size swap. The old rule of thumb of 2x RAM was reasonable in the 90s, but after that, it should be 2x RAM or 512MB, whichever is smaller. Nobody needs a 2TB swap volume on their 1TB ram server.
If you've got something leaking a lot and fast, 512MB swap is going to fill up in seconds, not minutes. If you have a slower leak, swap usage provides a clear signal something is wrong and may give you a chance to intervene before the OOM killer. Even in fast death, swap usage may be useful forensics, if you record it at a high enough time resolution.
- seppel 4y ago> The old rule of thumb of 2x RAM was reasonable in the 90s, but after that, it should be 2x RAM or 512MB, whichever is smaller. This is exactly why I don't have swap for over a decade on my machines (since my machines have 16+ GB RAM). The mere 1/32 improvement is not worth the headaches of swap.