How do i change the swappiness values on redhat?



  • Also see: What is swappiness?

    The value for swappiness ranges from 0 - 100, setting it to 0 swap will not be used, 100 the server will use as much swap as possible.

    You can set the swappiness kernel value dynamically using:

    Check the current value.

    $ sudo sysctl vm.swappiness
    vm.swappiness = 30
    

    Set new value.

    $ sudo sysctl vm.swappiness=35
    

    or

    $ sudo sysctl -w vm.swappiness=35
    

    For permanent changes edit the /etc/sysctl.conf or a file under the /etc/sysctl.d file and change or add

    vm.swappiness = 35
    

    After editing the sysctl file run the following, the default file is /etc/sysctl.conf

    $ sysctl -p 
    

Log in to reply
 

© Lightnetics 2024