Glossary

What is swap?

Swap is disk space the operating system uses as overflow for memory, moving rarely used pages out of RAM so that the active ones fit.

When RAM is under pressure, Linux can write less-used memory pages to a swap partition or file and read them back when needed. A little swap in use is normal and harmless: idle pages, such as a long-running daemon’s startup code, are good candidates.

Trouble shows as swapping activity, not as the amount used. Sustained pages swapped in and out per second (si and so in vmstat) means the working set no longer fits in RAM, and every access costs a disk read that is thousands of times slower than memory. The server slows down, iowait rises, and the out-of-memory killer may follow. Cloud instances often have no swap by default, which turns the same pressure into an immediate kill instead of a slowdown.

Example

$ free -h
              total   used   free  shared  buff/cache  available
Mem:           3.8Gi  3.4Gi  110Mi    24Mi       310Mi       180Mi
Swap:          2.0Gi  1.1Gi  0.9Gi

How WatchTower15 checks it

WatchTower15's Memory activity chart shows pages swapped in and out per second, and major page faults, for each server.