Ben's notes

Linux, Unix, network, radio...

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: 2021/10/09 15:14 by 127.0.0.1