Calculate swap space usage percentage and estimate performance impact of swapping.
vm.swappiness (0-100) controls how aggressively the kernel moves anonymous memory pages to swap versus reclaiming page cache first — higher values swap more readily to preserve cache, lower values keep more in RAM and reclaim cache first. Swap usage percentage alone doesn't indicate a problem (Linux may swap out genuinely idle pages even with plenty of free RAM to keep it available for cache), but sustained high swap-in/swap-out activity (visible via vmstat's si/so columns) under active use is the real latency red flag.
Swap utilization
swap_used% = swap_used / swap_total × 100
Not necessarily — the kernel may proactively swap out pages that haven't been touched in a long time even when RAM isn't under pressure, freeing that RAM for cache. The concerning signal is active swap-in/swap-out traffic (vmstat si/so) happening continuously, which indicates real memory pressure rather than idle-page housekeeping.
Setting it to 0 (or 1 on modern kernels, since 0 can behave like 'disable swap' in some kernel versions) tells the kernel to avoid swapping unless nearly out of memory — often recommended for latency-sensitive services like Redis or databases, but risky on memory-constrained systems since it removes swap's cushion against sudden OOM kills.
Run `vmstat 1` and watch the si (swap-in) and so (swap-out) columns — non-zero, sustained values there indicate active paging under memory pressure, which is a more direct performance signal than the static swap-used percentage alone.