Table of Contents

Use Proc Sys And Sysctl To Modify And Set Kernel Runtime Parameters

General Information

Modifying runtime or persistent kernel parameters.


Lab Setup

The following virtual machines will be used:


Help

Finding help in this section.


Runtime Kernel Settings

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

Persistent Kernel Settings

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

Tuned is a “dynamic adaptive system tuning daemon”.


View the active tuned profile

tuned-adm active