Linux operating systems use swap space, which is enabled by default, to help manage memory (pages) by copying pages from RAM to disk. Due to the way Redis Enterprise Software utilizes and manages memory, it is best to prevent OS swapping. For more details, see memory limits. The recommendation is to turn off Linux swap completely in the OS.

When you install or build the OS on the machine intended to host your Redis Enterprise Software cluster, avoid configuring swap partitions if possible.

Turn off swap

To turn off swap in the OS of an existing server, VM, or instance, you must have sudo access or be a root user to run the following commands:

  1. Turn off swap:

    sudo swapoff -a
    
  2. Comment out the swap partitions configured in the OS so swap remains off even after a reboot:

    sudo sed -i.bak '/ swap / s/^(.*)$/#1/g' /etc/fstab