In what situation would you be 100 % sure you could never run out of RAM or would rather have an OOM situation than using swap? Seems extremely counter-intuitive to me.
In what situation would you be 100 % sure you could never run out of RAM or would rather have an OOM situation than using swap? Seems extremely counter-intuitive to me.
If the chosen process is a database... That's not funny. At all.
Edit: you could adjust the oom score to avoid Linux killing important process, but I don't want to discover if Linux is actually going to follow the oom score or just "keep it in mind" when choosing a process to sacrifice.
Also swap on spinning disk is 100% pointless in most cases and many servers are still on spinning disk only as is appropriate for their usage.
On a server running data intensive applications you generally have your memory divided pretty cleanly into scratch space and working set you absolutely don't want swapped out, and data on disk that is swapped out either via a buffer pool or the page cache. The application manages which category memory utilization falls into in order to ensure consistent performance and to avoid things like event loop threads blocking on swap or threads holding locks blocking on swap.
Swap works great on desktops now that SSDs are a thing and it regularly cleans up after messy applications on my MacOS laptop. Compressed memory is also great. Granted performance on my Mac is abysmal, browser tabs take seconds to open and accept input, apps need to warm up after a context switch, but it beats opening and closing stuff constantly.