Swappiness setting
How do I permanently change the swapiness in Fedora 23.
How do I permanently change the swapiness in Fedora 23.
You can define swapiness in /etc/sysctl.d/99-sysctl.conf (sudo gedit /etc/sysctl.d/99-sysctl.conf
) by adding:
vm.swappiness = x
for example:
vm.swappiness = 10
You should be able to check the swappiness afterwards by running sysctl vm.swappiness
.
If you want to temporarily change the "swappiness" value, use the sysctl
tool ("-w" means "write", this will change the value):
# sysctl -w vm.swappiness=10
Verify the value:
# sysctl vm.swappiness
vm.swappiness = 10
The value will be reset on reboot (usually to 60). If you want to change it permanently, put the desired value in a sysctl config file. It's recommended to use a separate file to not accidentally change or overwrite other sysctl settings (if you overwrite the global "sysctl.conf", you'll lose whatever was in there).
# echo 'vm.swappiness=1' >/etc/sysctl.d/swappiness.conf
Now, to apply the new value, tell sysctl
to use it:
# sysctl -p /etc/sysctl.d/swappiness.conf
Verify it:
# sysctl vm.swappiness
vm.swappiness = 1
Naturally, these commands must be run as root. Use sudo
or just su
if sudo
is not configured on your system.
Asked: 2015-12-02 18:47:00 -0600
Seen: 7,859 times
Last updated: May 25 '18
Which memory configuration for a linux VM in gnome boxes?
Increase swap space in fedora 19
What happens with swap partition if I add more memory?
What are the options for memory test in Fedora 27?
Fedora memory management terrible [closed]
Fedora 16 XFCE, 768mb to install?
My swap partition is between / and /home. Is that a problem?
It's called "swappiness" (typo).
To change the swappiness configuration:
Execute. cat /proc/sys/vm/swappiness. Execute. sudo sysctl vm.swappiness=0. TT Rock Stars To ensure that this setting persists through the server restarts: Use sudo or root user privileges to edit the kernel parameters configuration file /etc/sysctl.conf, so that the change is always in effect.