Disable swap
Swap space is used by the Linux OS to help manage memory (pages) by copying pages from RAM to disk and the OS is configured by default to be fairly aggressive. For Redis, the memory cache used by OpenIAM, it is best to eliminate the likelihood of the OS swapping
Having Swap enable can have a detrimental impact on system performance. Use the steps below to determine if swap is enable and then to disable it.
Check the swap status
You can check if swap is enabled using the following approach:
blkid
If swap is enabled you will see a response like the example below:
/dev/sda: LABEL="linode-root" UUID="08d2452f-b202-b5e2-e64b-d7da78446d85" BLOCK_SIZE="4096" TYPE="ext4"/dev/sdb: UUID="f9cfae4d-679b-4c1d-8519-d896c515609d" TYPE="swap"
Disable swap
Disable swap by using the command below:
swapoff -a
This will immediately disable swap. However, to ensure that swap stays off after a reboot, follow the steps below:
- Edit /etc/fstab
- Put a # (hashtag) sign in front of the line to comment on the entire line which contains the word
swap
- If you want to load the changes right away, you can use
systemctl daemon-reload