Chapter 3. Setting persistent kernel tuning parameters
When you have decided on a tuning configuration that works for your system, you can make the changes persistent across reboots.
By default, edited kernel tuning parameters only remain in effect until the system reboots or the parameters are explicitly changed. This is effective for establishing the initial tuning configuration. It also provides a safety mechanism. If the edited parameters cause the machine to behave erratically, rebooting the machine returns the parameters to the previous configuration.
3.1. Making persistent kernel tuning parameter changes Copy linkLink copied to clipboard!
You can make persistent changes to kernel tuning parameters by adding the parameter to the /etc/sysctl.conf file.
This procedure does not change any of the kernel tuning parameters in the current session. The changes entered into /etc/sysctl.conf only affect future sessions.
Prerequisites
- You have root permissions on the system.
Procedure
-
Open
/etc/sysctl.confin a text editor. Insert the new entry into the file with the parameter’s value.
Modify the parameter name by removing the
/proc/sys/path, changing the remaining slash (/) to a period (.), and including the parameter’s value.For example, to make the command
echo 0 > /proc/sys/kernel/hung_task_panicpersistent, enter the following into/etc/sysctl.conf:Enable gettimeofday(2)
# Enable gettimeofday(2) kernel.hung_task_panic = 0Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Save and close the file.
- Reboot the system for changes to take effect.
Verification
To verify the configuration:
cat /proc/sys/kernel/hung_task_panic 0
# cat /proc/sys/kernel/hung_task_panic 0Copy to Clipboard Copied! Toggle word wrap Toggle overflow