Skip to content

Commit 5a6bec3

Browse files
committed
github-ci: switch off swap use
Github Actions provides hosts for Linux base runners in the following configurations: 2 Cores 7 Gb memory 4 Gb swap memory To avoid of issues with hanging/slowing tests on high memory use like [1], hosts configurations must avoid of swap memory use. All of the tests workflows run inside dockers containers. This patch sets in docker run configurations memory limits based on current github actions hosts - 7Gb memory w/o swap memory increase. Checked 8 full runs (29 workflows in each run used the change) and got single failed test on gevent() routine in test-run. This result much better than w/o this patch when 3-4 of workflows fail on each full run. It could happen because swap began to be used after 40% of RAM was used: cat /sys/fs/cgroup/memory/memory.swappiness 60 This default vm.swappiness value of 60% represents the percentage of the free memory before activating swap. The lower the value, the less swapping is used and the more memory pages are kept in physical memory. This swappiness value was not enough tunned for perfomance testing as suggested in [2]. For performance testing better to use lower values like 10% or even better not use swap at all. For Github Actions host configurations with 7Gb RAM it means that after 2.8Gb RAM was used swap began to use. But in testing we have some tests that use 2.5Gb of RAM like 'box/net_msg_max.test.lua' and memory fragmentation could cause after the test run swap use [3]. To fix the issue there were made 3 changes: - For jobs that run tests and use actions/environment and don't use Github Actions container tag, it was set 'swapoff -a' command in actions/environment action. - For jobs that run tests and use Github Actions container tag the previous solution doesn't work. It was decided to hardcode the memory value based on found on Github Actions hosts memory size 7Gb. It was set for Github container tag as additional options: options: '--init --memory=7G --memory-swap=7G' This changes were made temporary till these containers tags will be removed within resolving tarantool/tarantool-qa#101 issue for workflows: debug_coverage release release_asan_clang11 release_clang release_lto release_lto_clang11 static_build static_build_cmake_linux - For OSX switching off swap was made with command: Closes tarantool/tarantool-qa#99 [1]: tarantool/tarantool-qa#93 [2]: https://linuxhint.com/understanding_vm_swappiness/ [3]: https://unix.stackexchange.com/questions/2658/why-use-swap-when-there-is-more-than-enough-free-space-in-ram
1 parent 6d6a153 commit 5a6bec3

File tree

9 files changed

+13
-8
lines changed

9 files changed

+13
-8
lines changed

.github/actions/environment/action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,9 @@ runs:
88
echo TEST_TIMEOUT=310 | tee -a $GITHUB_ENV
99
echo NO_OUTPUT_TIMEOUT=320 | tee -a $GITHUB_ENV
1010
echo PRESERVE_ENVVARS=REPLICATION_SYNC_TIMEOUT,TEST_TIMEOUT,NO_OUTPUT_TIMEOUT | tee -a $GITHUB_ENV
11+
# This switching off swap command will not work as github step
12+
# run from inside container tag. To switch off swap inside
13+
# github container tag it should be run with additional options:
14+
# options: '--memory=<some value, like 7G> --memory-swap=<the same value as for memory option>'
15+
sudo /sbin/swapoff -a
1116
shell: bash

.github/workflows/debug_coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
# Our testing expects that the init process (PID 1) will
3030
# reap orphan processes. At least the following test leans
3131
# on it: app-tap/gh-4983-tnt-e-assert-false-hangs.test.lua.
32-
options: '--init'
32+
options: '--init --memory=7G --memory-swap=7G'
3333

3434
steps:
3535
- uses: actions/checkout@v1

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
# Our testing expects that the init process (PID 1) will
3030
# reap orphan processes. At least the following test leans
3131
# on it: app-tap/gh-4983-tnt-e-assert-false-hangs.test.lua.
32-
options: '--init'
32+
options: '--init --memory=7G --memory-swap=7G'
3333

3434
steps:
3535
- uses: actions/checkout@v1

.github/workflows/release_asan_clang11.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
# Our testing expects that the init process (PID 1) will
3030
# reap orphan processes. At least the following test leans
3131
# on it: app-tap/gh-4983-tnt-e-assert-false-hangs.test.lua.
32-
options: '--init'
32+
options: '--init --memory=7G --memory-swap=7G'
3333

3434
steps:
3535
- uses: actions/[email protected]

.github/workflows/release_clang.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
# Our testing expects that the init process (PID 1) will
3030
# reap orphan processes. At least the following test leans
3131
# on it: app-tap/gh-4983-tnt-e-assert-false-hangs.test.lua.
32-
options: '--init'
32+
options: '--init --memory=7G --memory-swap=7G'
3333

3434
steps:
3535
- uses: actions/checkout@v1

.github/workflows/release_lto.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
# Our testing expects that the init process (PID 1) will
3030
# reap orphan processes. At least the following test leans
3131
# on it: app-tap/gh-4983-tnt-e-assert-false-hangs.test.lua.
32-
options: '--init'
32+
options: '--init --memory=7G --memory-swap=7G'
3333

3434
steps:
3535
- uses: actions/[email protected]

.github/workflows/release_lto_clang11.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
# Our testing expects that the init process (PID 1) will
3030
# reap orphan processes. At least the following test leans
3131
# on it: app-tap/gh-4983-tnt-e-assert-false-hangs.test.lua.
32-
options: '--init'
32+
options: '--init --memory=7G --memory-swap=7G'
3333

3434
steps:
3535
- uses: actions/[email protected]

.github/workflows/static_build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
# Our testing expects that the init process (PID 1) will
3030
# reap orphan processes. At least the following test leans
3131
# on it: app-tap/gh-4983-tnt-e-assert-false-hangs.test.lua.
32-
options: '--init'
32+
options: '--init --memory=7G --memory-swap=7G'
3333

3434
steps:
3535
- uses: actions/checkout@v1

.github/workflows/static_build_cmake_linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
# Our testing expects that the init process (PID 1) will
3030
# reap orphan processes. At least the following test leans
3131
# on it: app-tap/gh-4983-tnt-e-assert-false-hangs.test.lua.
32-
options: '--init'
32+
options: '--init --memory=7G --memory-swap=7G'
3333

3434
steps:
3535
- uses: actions/checkout@v1

0 commit comments

Comments
 (0)