Add file-backed swap to prevent OOM
Without any swap space enabled, it's possible some intensive operation can chew up all the memory on the test VM. Enabling swap space will prevent this for minor cases, but could lead to disk-thrashing if the memory demand is excessive. Since the test system never reboots, using a file-backed swap should suffice. Though not ideal, it's easy to setup and doesn't require any interactions with the cloud that owns the VM or the job that created it. Signed-off-by: Chris Evich <cevich@redhat.com>
This commit is contained in:
parent
173d56cc67
commit
f65d548ac2
1 changed files with 7 additions and 0 deletions
|
@ -76,6 +76,13 @@
|
|||
async: 600
|
||||
poll: 10
|
||||
when: ansible_distribution == 'Fedora'
|
||||
- name: Setup swap to prevent kernel firing off the OOM killer
|
||||
shell: |
|
||||
truncate -s 8G /root/swap && \
|
||||
export SWAPDEV=$(losetup --show -f /root/swap | head -1) && \
|
||||
mkswap $SWAPDEV && \
|
||||
swapon $SWAPDEV && \
|
||||
swapon --show
|
||||
- name: Make testing directories to conform to testing standards
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
|
|
Loading…
Reference in a new issue