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

[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 21, 2023
1 parent 5010e9a commit c096df2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions vms/vm-under-test/scripts/first-boot
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@ 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

swapoff -a
sed -i '/swap/s/^/#/' /etc/fstab
systemctl mask "$(systemctl --type swap | grep '.swap' | awk '{print $1}')"

reboot

0 comments on commit c096df2

Please sign in to comment.