Adjusting Swappiness on Linux

1 minute readReference

For Java-based machines (CloudBees CD/RO server, repository server, and agent), you should adjust the swappiness kernel parameter to favor applications over disk cache.

To favor applications 100% over disk cache:

  • Enter the following command:

    sysctl -w vm.swappiness=0

    The default of 60 can result in significant delays during garbage collection if any I/O-intensive process runs on the machine.

  • Add the following line to the /etc/sysctl.conf file:


    This preserves the swappiness setting when the machine reboots.

For more details about vm.swappiness see or documentation from your chosen Linux distribution.