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

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/09/18 16:52]
billdozor [Tuned]
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<code bash>man sysctl</code>
  
 ---- ----
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
 </code> </code>
   * -w -> write   * -w -> write
Line 44: Line 61:
  
   * Default system values: /usr/lib/sysctl.d/   * Default system values: /usr/lib/sysctl.d/
-  * Persistent configuration over rides: /etc/sysctl.conf+  * Persistent configuration over rides: /etc/sysctl.d/filename.conf
  
 \\ \\
-Create entries in /etc/sysctl.conf+Create entries in /etc/sysctl.d/mychanges.conf
 <code bash> <code bash>
 vim /etc/sysctl.conf vim /etc/sysctl.conf
Line 57: Line 74:
 Load settings from a file Load settings from a file
 <code bash> <code bash>
-sysctl -p <filename>+sysctl -p /etc/sysctl.d/mychanges.conf
 </code> </code>
   * If no file name is specified, defaults to: /etc/sysctl.conf   * If no file name is specified, defaults to: /etc/sysctl.conf
 +
 +\\
 +Load all settings
 +<code bash>
 +sysctl --system
 +</code>
  
 ===== Tuned ===== ===== Tuned =====
Line 65: Line 88:
 Tuned is a "dynamic adaptive system tuning daemon". Tuned is a "dynamic adaptive system tuning daemon".
  
-Starting in EL 7.2, some parameters (such as vm.swappiness) are set AFTER systemd-sysctl.service by the tuned service.+  * **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> 
 +  * Either way; be aware of tuned and its potential to conflict with sysctl.
  
 \\ \\
  • linux_wiki/use_proc_sys_and_sysctl_to_modify_and_set_kernel_runtime_parameters.1474231966.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)