Work out swappiness effect instantly with clear inputs, formula shown and shareable results.
vm.swappiness balances reclaim between anonymous process memory and page cache, on a scale where 0 strongly prefers dropping cache and 100 treats them equally — values above 100 favour swapping. It is not an on/off switch: even at 0 the kernel will swap rather than invoke the OOM killer. Latency-sensitive databases typically set it to 1 or 10.
Swappiness balance
anonymous reclaim share ~ swappiness / 200; page cache share = 1 - that; swappiness 0 still permits swap under real pressure
It reduces swapping but does not prevent it, and it increases the chance of the OOM killer firing. A value of 1 to 10 is the usual recommendation for databases.
On systems with idle memory-hungry processes and a heavy file workload, swapping out cold anonymous pages to keep more cache resident genuinely improves throughput.