setting swappiness issue

I tried setting the swappiness by doing:

# sysctl -w vm.swappiness=10
# echo 10 > /proc/sys/vm/swappiness

but bwhenever I reboot, the swapiness value is back to its default of 60 (as reported by sysctl) and the file /proc/sys/vm/swapiness also contains 60 again.

NewLine:
I tried setting the swappiness by doing:

# sysctl -w vm.swappiness=10

echo 10 > /proc/sys/vm/swappiness





but bwhenever I reboot, the swapiness value is back to its default of 60 (as reported by sysctl) and the file /proc/sys/vm/swapiness also contains 60 again.

NewLine,
yes, that's why they call it the default. If you want to change it on boot up, add a line (before exit 0) in

/etc/rc.local

that calls your script. Make sure to make your script executable (chmod +x) and, of
course, make sure the owner is root.

Jesse

Thanks. I thought putting it in the file was to remember between boots. Apparently not.

In the mean time I learned that a permanent change can also be done via/etc/sysctl.conf

NewLine:
Thanks. I thought putting it in the file was to remember between boots. Apparently not.

In the mean time I learned that a permanent change can also be done via /etc/sysctl.conf

NewLine,
Yes, of course you can do it in /etc/sysctl.conf. One consideration is documentation.
If you do it in /etc/sysctl.conf make sure you save the original file, and document the change.
Those coming after you will need to know.... This include you at some future date.. Say in several
months -- when you've completely forgotten this.

Jesse