Configure kernel parameters permanently with sysctl

You can use the sysctl command to permanently set kernel parameters.

Before you begin

  • You have root permissions on the system.

Procedure

  1. List all parameters:
    # sysctl -a

    The command displays all kernel parameters that can be configured at runtime.

  2. Configure a parameter permanently:
    # sysctl -w <TUNABLE_CLASS>.<PARAMETER>=<TARGET_VALUE> >> /etc/sysctl.conf

    The sample command changes the tunable value and writes it to the /etc/sysctl.conf file, which overrides the default values of kernel parameters. The changes take effect immediately and persistently, without a need for restart.

    Note

    To permanently modify kernel parameters, you can also make manual changes to the configuration files in the /etc/sysctl.d/ directory.