https://haydenjames.io/linux-performance-almost-always-add-swap-space/
— It’s better to swap out a memory pages that have been inactive for a while and instead keep often-used files in cache and to do this when the server is most idle, which is the aim of the Kernel.
— Avoid setting your swap space too large if it will result in prolonging performance issues, outages or your response time (without proper monitoring/alerts).
(略)
If you don’t have enough memory and no swap space, this will often cause failure to allocate memory for requests needing more memory pages. As a last resort, the Kernel will deploy OOM killer to nuke high-memory process(es).
(略)
— It’s better to swap out a memory pages that have been inactive for a while and instead keep often-used files in cache and to do this when the server is most idle, which is the aim of the Kernel.
— Avoid setting your swap space too large if it will result in prolonging performance issues, outages or your response time (without proper monitoring/alerts).
正論