JosefJezek
5/15/2015 - 10:44 AM

Swap on Linux

Swap on Linux

Swap on Linux

Swap File

sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon -s
free -m
sudo vi /etc/fstab
/swapfile   none    swap    sw    0   0

Swap Settings

cat /proc/sys/vm/swappiness
sudo sysctl vm.swappiness=10
sudo vi /etc/sysctl.conf
vm.swappiness=10
cat /proc/sys/vm/vfs_cache_pressure
sudo sysctl vm.vfs_cache_pressure=50
sudo vi /etc/sysctl.conf
vm.vfs_cache_pressure = 50