Differences
This shows you the differences between two versions of the page.
linux_wiki:use_proc_sys_and_sysctl_to_modify_and_set_kernel_runtime_parameters [2016/09/18 16:50] billdozor [Persistent Kernel Settings] |
linux_wiki:use_proc_sys_and_sysctl_to_modify_and_set_kernel_runtime_parameters [2019/05/25 23:50] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Use Proc Sys And Sysctl To Modify And Set Kernel Runtime Parameters ====== | ||
- | |||
- | **General Information** | ||
- | |||
- | Modifying runtime or persistent kernel parameters. | ||
- | |||
- | ---- | ||
- | |||
- | ====== 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 | ||
- | <code bash> | ||
- | sysctl -a | ||
- | </ | ||
- | |||
- | \\ | ||
- | View the configuration of a specific setting | ||
- | <code bash> | ||
- | sysctl vm.swappiness | ||
- | </ | ||
- | |||
- | \\ | ||
- | Write a runtime only configuration change and verify | ||
- | <code bash> | ||
- | sysctl -w vm.swappiness=10 | ||
- | sysctl vm.swappiness | ||
- | </ | ||
- | * -w -> write | ||
- | |||
- | \\ | ||
- | Alternative: | ||
- | <code bash> | ||
- | 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: / | ||
- | |||
- | \\ | ||
- | **Note**: Starting in CentOS 7.2, some parameters (such as vm.swappiness) are set AFTER systemd-sysctl.service by the tuned service. | ||
- | |||
- | \\ | ||
- | 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< | ||
- | |||
- | ---- | ||