How to check if any MySQL memory has been swapped out? This post explains it.
Check if system is currently using any swap:
server ~ # free -m
total used free shared buffers cached
Mem: 3954 2198 1755 0 190 1040
-/+ buffers/cache: 968 2985
Swap: 3906 0 3906
In the above example swap is not in use, so no further checks would be necessary.
However if free command would report some usage, how
to check whether MySQL memory was swapped out or not?
It is not possible to determine that using standard tools such as
ps or top. They will report various
memory related information per each process, but no clear
indication whether something is in RAM or in swap space. But it
is possible with this trivial command:
awk '/^Swap:/ { SWAP+=$2 } END { print …