Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux_wiki:use_proc_sys_and_sysctl_to_modify_and_set_kernel_runtime_parameters [2016/08/10 22:35] billdozor [Runtime Kernel Settings] |
linux_wiki:use_proc_sys_and_sysctl_to_modify_and_set_kernel_runtime_parameters [2019/05/25 23:50] (current) |
||
---|---|---|---|
Line 4: | Line 4: | ||
Modifying runtime or persistent kernel parameters. | Modifying runtime or persistent kernel parameters. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ====== Lab Setup ====== | ||
+ | |||
+ | The following virtual machines will be used: | ||
+ | * server1.example.com (192.168.1.150) -> Configure the kernel parameters here | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ====== Help ====== | ||
+ | |||
+ | Finding help in this section. | ||
+ | * Sysctl man page< | ||
---- | ---- | ||
Line 28: | Line 42: | ||
sysctl -w vm.swappiness=10 | sysctl -w vm.swappiness=10 | ||
sysctl vm.swappiness | sysctl vm.swappiness | ||
+ | |||
+ | # Or | ||
+ | sysctl -a | grep swappiness | ||
</ | </ | ||
* -w -> write | * -w -> write | ||
Line 36: | Line 53: | ||
echo " | echo " | ||
</ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ====== Persistent Kernel Settings ====== | ||
+ | |||
+ | To make changes that are persistent across reboots... | ||
+ | |||
+ | * Default system values: / | ||
+ | * Persistent configuration over rides: / | ||
+ | |||
+ | \\ | ||
+ | Create entries in / | ||
+ | <code bash> | ||
+ | vim / | ||
+ | |||
+ | net.ipv4.ip_forward = 1 | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | Load settings from a file | ||
+ | <code bash> | ||
+ | sysctl -p / | ||
+ | </ | ||
+ | * If no file name is specified, defaults to: / | ||
+ | |||
+ | \\ | ||
+ | Load all settings | ||
+ | <code bash> | ||
+ | sysctl --system | ||
+ | </ | ||
+ | |||
+ | ===== Tuned ===== | ||
+ | |||
+ | Tuned is a " | ||
+ | |||
+ | * **Notes** | ||
+ | * Starting in EL 7.2, some parameters (such as vm.swappiness) are set AFTER systemd-sysctl.service by the tuned service. | ||
+ | * In EL 7.4, it appears that tuned defaults to honor sysctl (/ | ||
+ | # Whether to reapply sysctl from the e.g / | ||
+ | # 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....</ | ||
+ | * Either way; be aware of tuned and its potential to conflict with sysctl. | ||
+ | |||
+ | \\ | ||
+ | View the active tuned profile | ||
+ | <code bash> | ||
+ | tuned-adm active | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | * Location of built in system tuned profiles: / | ||
+ | * Location of user defined profiles: /etc/tuned | ||
+ | * **Example**: | ||
+ | cp / | ||
+ | * Edit the over ride file (/ | ||
+ | * Restart the tuned service< | ||
---- | ---- | ||