Change swappiness at runtime
reduce swappiness | server swaps too early | set vm.swappiness | sysctl | swap | swappiness | kernelCaution: This command changes the system. Understand what it does before you run it.
sysctl vm.swappiness=10Changes how early the kernel moves memory pages to swap. On database and web servers with enough RAM, a value around 10 is common, so active data stays in memory longer. The change takes effect immediately and can be reverted at any time.
Note: To make the value permanent, create a file like /etc/sysctl.d/99-swappiness.conf containing vm.swappiness=10 and load it with sysctl --system.
Also searched as
- reduce swappiness
- server swaps too early
- set vm.swappiness