Добавление swap на Debian 8

fallocate -l 4G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo "/swapfile   none    swap    sw    0   0" >> /etc/fstab
sysctl vm.swappiness=10
echo "vm.swappiness=10" >> /etc/sysctl.conf
sysctl vm.vfs_cache_pressure=50
echo "vm.vfs_cache_pressure=50" >> /etc/sysctl.conf

тестим результат

# You should see swap in use now:
free -m
 
# Swappiness should now be 10
cat /proc/sys/vm/swappiness
 
# Cache pressure should be set to 50
cat /proc/sys/vm/vfs_cache_pressure

 

Теги: