Skip to content

Commit

Permalink
vm-under-test: Permanently disable swap space
Browse files Browse the repository at this point in the history
Disabling swap space since it will introduce potential latency.
In order to permanently disable [0], this commit is:
- using the swapoff command.
- commenting the swap entries on /etc/fstab.
- masking the swap service with systemctl (done during the first-boot)

[0]
https://askubuntu.com/questions/440326/how-can-i-turn-off-swap-permanently/984777#984777

Signed-off-by: Ram Lavi <ralavi@redhat.com>
  • Loading branch information
RamLavi committed Nov 23, 2023
1 parent 62351d3 commit c688998
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vms/vm-under-test/scripts/customize-vm
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ systemctl disable irqbalance

dnf --enablerepo=rt install -y tuned-profiles-realtime
dnf --enablerepo=nfv install -y tuned-profiles-nfv-guest

swapoff -a
sed -i '/swap/s/^/#/' /etc/fstab
2 changes: 2 additions & 0 deletions vms/vm-under-test/scripts/first-boot
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

set -e

systemctl mask "$(systemctl --type swap | grep '.swap' | awk '{print $1}')"

echo isolated_cores=1-2 >> /etc/tuned/realtime-virtual-guest-variables.conf
echo isolate_managed_irq=Y >> /etc/tuned/realtime-virtual-guest-variables.conf
tuned-adm profile realtime-virtual-guest
Expand Down

0 comments on commit c688998

Please sign in to comment.