linux_wiki:use_proc_sys_and_sysctl_to_modify_and_set_kernel_runtime_parameters

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

linux_wiki:use_proc_sys_and_sysctl_to_modify_and_set_kernel_runtime_parameters [2018/03/30 00:48]
billdozor [Tuned]
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.  
- 
----- 
- 
-====== Lab Setup ====== 
- 
-The following virtual machines will be used: 
-  * server1.example.com (192.168.1.150) -> Configure the kernel parameters here 
- 
----- 
- 
-====== 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 
-</code> 
- 
-\\ 
-View the configuration of a specific setting 
-<code bash> 
-sysctl vm.swappiness 
-</code> 
- 
-\\ 
-Write a runtime only configuration change and verify 
-<code bash> 
-sysctl -w vm.swappiness=10 
-sysctl vm.swappiness 
- 
-# Or 
-sysctl -a | grep swappiness 
-</code> 
-  * -w -> write 
- 
-\\ 
-Alternative: Echo the value into the correct location in /proc 
-<code bash> 
-echo "15" > /proc/sys/vm/swappiness 
-</code> 
- 
----- 
- 
-====== Persistent Kernel Settings ====== 
- 
-To make changes that are persistent across reboots... 
- 
-  * Default system values: /usr/lib/sysctl.d/ 
-  * Persistent configuration over rides: /etc/sysctl.d/filename.conf 
- 
-\\ 
-Create entries in /etc/sysctl.d/mychanges.conf 
-<code bash> 
-vim /etc/sysctl.conf 
- 
-net.ipv4.ip_forward = 1 
-</code> 
- 
-\\ 
-Load settings from a file 
-<code bash> 
-sysctl -p /etc/sysctl.d/mychanges.conf 
-</code> 
-  * If no file name is specified, defaults to: /etc/sysctl.conf 
- 
-\\ 
-Load all settings 
-<code bash> 
-sysctl --system 
-</code> 
- 
-===== Tuned ===== 
- 
-Tuned is a "dynamic adaptive system tuning daemon". 
- 
-  * **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 (/etc/tuned/tuned-main.conf)<code bash>....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....</code> 
- 
-\\ 
-View the active tuned profile 
-<code bash> 
-tuned-adm active 
-</code> 
- 
-\\ 
-  * Location of built in system tuned profiles: /usr/lib/tuned/ 
-  * Location of user defined profiles: /etc/tuned 
-  * **Example**: Create a virtual-guest override file<code bash>mkdir /etc/tuned/virtual-guest 
-cp /usr/lib/tuned/virtual-guest/tuned.conf /etc/tuned/virtual-guest/</code> 
-    * Edit the over ride file (/etc/tuned/virtual-guest/tuned.conf), make any changes. 
-    * Restart the tuned service<code bash>systemctl restart tuned</code> 
- 
----- 
  
  • linux_wiki/use_proc_sys_and_sysctl_to_modify_and_set_kernel_runtime_parameters.txt
  • Last modified: 2019/05/25 23:50
  • (external edit)