Swap: Difference between revisions
Jump to navigation
Jump to search
Line 10: | Line 10: | ||
To set swippiness value. | To set swippiness value. | ||
sudo sysctl vm.swappiness=0 | sudo sysctl vm.swappiness=0 | ||
sort processes on swap usage. | |||
for file in /proc/*/status ; do awk '/VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; done | sort -k2 -n | tail |
Revision as of 14:46, 29 August 2019
How to handle swappiness
Start top and press O then p to sort by swap.
top -c
Look at what is using swap. si and so is swap in and swap out.
vmstat 1
To return swap to ram.
swapoff -a; swapon -a
See swappiness value.
cat /proc/sys/vm/swappiness
To set swippiness value.
sudo sysctl vm.swappiness=0
sort processes on swap usage.
for file in /proc/*/status ; do awk '/VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; done | sort -k2 -n | tail