Ben Stienstra

Linux, Unix, network, radio and more...

User Tools

Site Tools


reduce_swappiness

Reduce swappiness

If you have enough RAM, then you can reduce swappiness and thus avoid writes to swap.

  • Check current setting:
    cat /proc/sys/vm/swappiness
    cat /proc/sys/vm/vfs_cache_pressure
  • Change setting, edit /etc/sysctl.d/swappiness.conf.
    mkdir -p /etc/sysctl.d
    vi /etc/sysctl.d/swappiness.conf
    vm.swappiness=1
    vm.vfs_cache_pressure=50
  • Then activate the change.
    sysctl -p /etc/sysctl.d/swappiness.conf
reduce_swappiness.txt · Last modified: 2014/05/22 11:18 by admin