General Information
Modifying runtime or persistent kernel parameters.
The following virtual machines will be used:
Finding help in this section.
man sysctl
Everything in this section are runtime ONLY changes; the values will go back to their original setting upon reboot.
View all tunable kernel parameters
sysctl -a
View the configuration of a specific setting
sysctl vm.swappiness
Write a runtime only configuration change and verify
sysctl -w vm.swappiness=10 sysctl vm.swappiness # Or sysctl -a | grep swappiness
Alternative: Echo the value into the correct location in /proc
echo "15" > /proc/sys/vm/swappiness
To make changes that are persistent across reboots…
Create entries in /etc/sysctl.d/mychanges.conf
vim /etc/sysctl.conf net.ipv4.ip_forward = 1
Load settings from a file
sysctl -p /etc/sysctl.d/mychanges.conf
Load all settings
sysctl --system
Tuned is a “dynamic adaptive system tuning daemon”.
....SNIP.... # Whether to reapply sysctl from the e.g /etc/sysctl.conf, /etc/sysctl.d, ... # If enabled these sysctls will be re-appliead after Tuned sysctls are # applied, i.e. Tuned sysctls will not override system sysctls. reapply_sysctl = 1 ....SNIP....
View the active tuned profile
tuned-adm active
mkdir /etc/tuned/virtual-guest cp /usr/lib/tuned/virtual-guest/tuned.conf /etc/tuned/virtual-guest/
systemctl restart tuned