From ef15b64d9ae28de5df21a7e8a64c903ac3283743 Mon Sep 17 00:00:00 2001 From: Adam Gutglick Date: Mon, 2 Mar 2026 15:07:07 +0000 Subject: [PATCH 1/5] Linux cleanup script to reduce benchmark noise Signed-off-by: Adam Gutglick --- scripts/setup-benchmark.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 scripts/setup-benchmark.sh diff --git a/scripts/setup-benchmark.sh b/scripts/setup-benchmark.sh new file mode 100755 index 00000000000..d4e871aa7ce --- /dev/null +++ b/scripts/setup-benchmark.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: Copyright the Vortex contributors + +set -Eeu -o pipefail -x + +if [ "$EUID" -ne 0 ]; then + echo "Environment setup script for benchmarks should run as root." + exit 0 +fi + +# Really discourage swapping to disk +sudo sysctl vm.swappiness=0 + +# Disable ASLR - https://docs.kernel.org/admin-guide/sysctl/kernel.html#randomize-va-space +sudo sysctl kernel.randomize_va_space + +# Reduce kernel logging to minimum +dmesg -n 1 + +# Disable some unused services and features +sudo systemctl stop apparmor snapd unattended-upgrades multipathd ModemManager +sudo systemctl disable apparmor snapd unattended-upgrades multipathd ModemManager + +# mask prevents them from being started by other services +sudo systemctl mask snapd unattended-upgrades multipathd ModemManager + +# For apparmor specifically, also teardown loaded profiles +sudo aa-teardown + +# For auditd, also disable kernel audit +sudo auditctl -e 0 \ No newline at end of file From c9237e1a4d447190945708de8c4ec1a3dd04ceee Mon Sep 17 00:00:00 2001 From: Adam Gutglick Date: Mon, 2 Mar 2026 15:11:54 +0000 Subject: [PATCH 2/5] Try and reduce noise in benchmarking machines Signed-off-by: Adam Gutglick --- .github/workflows/bench-pr.yml | 2 ++ .github/workflows/bench.yml | 2 ++ .github/workflows/ci.yml | 2 ++ .github/workflows/sql-benchmarks.yml | 2 ++ 4 files changed, 8 insertions(+) diff --git a/.github/workflows/bench-pr.yml b/.github/workflows/bench-pr.yml index 7e6cd69b4aa..4d2af69aaee 100644 --- a/.github/workflows/bench-pr.yml +++ b/.github/workflows/bench-pr.yml @@ -54,6 +54,8 @@ jobs: - uses: actions/checkout@v6 with: ref: ${{ github.event.pull_request.head.sha }} + - name: Setup benchmark environment + run: sudo bash scripts/setup-benchmark.sh - uses: ./.github/actions/setup-rust with: repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 9743a554eae..e892bc10b63 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -56,6 +56,8 @@ jobs: with: sccache: s3 - uses: actions/checkout@v6 + - name: Setup benchmark environment + run: sudo bash scripts/setup-benchmark.sh - uses: ./.github/actions/setup-rust with: repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3d4b3e81b0..33d86276724 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -686,6 +686,8 @@ jobs: with: sccache: s3 - uses: actions/checkout@v6 + - name: Setup benchmark environment + run: sudo bash scripts/setup-benchmark.sh - uses: ./.github/actions/setup-rust with: repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/sql-benchmarks.yml b/.github/workflows/sql-benchmarks.yml index f98e7ef87d4..bdb78924313 100644 --- a/.github/workflows/sql-benchmarks.yml +++ b/.github/workflows/sql-benchmarks.yml @@ -115,6 +115,8 @@ jobs: - uses: actions/checkout@v6 if: inputs.mode != 'pr' + - name: Setup benchmark environment + run: sudo bash scripts/setup-benchmark.sh - uses: ./.github/actions/setup-rust with: repo-token: ${{ secrets.GITHUB_TOKEN }} From dc581e33a33d23e828dae65f75671807d56568c4 Mon Sep 17 00:00:00 2001 From: Adam Gutglick Date: Mon, 2 Mar 2026 15:30:14 +0000 Subject: [PATCH 3/5] fix? Signed-off-by: Adam Gutglick --- scripts/setup-benchmark.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/scripts/setup-benchmark.sh b/scripts/setup-benchmark.sh index d4e871aa7ce..7c49a2865dc 100755 --- a/scripts/setup-benchmark.sh +++ b/scripts/setup-benchmark.sh @@ -20,14 +20,11 @@ sudo sysctl kernel.randomize_va_space dmesg -n 1 # Disable some unused services and features -sudo systemctl stop apparmor snapd unattended-upgrades multipathd ModemManager -sudo systemctl disable apparmor snapd unattended-upgrades multipathd ModemManager +sudo systemctl stop apparmor ModemManager +sudo systemctl disable apparmor ModemManager # mask prevents them from being started by other services -sudo systemctl mask snapd unattended-upgrades multipathd ModemManager +sudo systemctl mask ModemManager # For apparmor specifically, also teardown loaded profiles sudo aa-teardown - -# For auditd, also disable kernel audit -sudo auditctl -e 0 \ No newline at end of file From 49f5e1b479ac19c6b2ba3ebd9876830937593be1 Mon Sep 17 00:00:00 2001 From: Adam Gutglick Date: Mon, 2 Mar 2026 15:36:22 +0000 Subject: [PATCH 4/5] Actually disable aslr Signed-off-by: Adam Gutglick --- scripts/setup-benchmark.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/setup-benchmark.sh b/scripts/setup-benchmark.sh index 7c49a2865dc..1c446379005 100755 --- a/scripts/setup-benchmark.sh +++ b/scripts/setup-benchmark.sh @@ -14,7 +14,7 @@ fi sudo sysctl vm.swappiness=0 # Disable ASLR - https://docs.kernel.org/admin-guide/sysctl/kernel.html#randomize-va-space -sudo sysctl kernel.randomize_va_space +sudo sysctl kernel.randomize_va_space=0 # Reduce kernel logging to minimum dmesg -n 1 From b72ba26126451fb6a5bc0e74e875b20e03af4540 Mon Sep 17 00:00:00 2001 From: Adam Gutglick Date: Mon, 2 Mar 2026 15:49:29 +0000 Subject: [PATCH 5/5] No need for sudo inside the script Signed-off-by: Adam Gutglick --- scripts/setup-benchmark.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/setup-benchmark.sh b/scripts/setup-benchmark.sh index 1c446379005..1e02d79cc3d 100755 --- a/scripts/setup-benchmark.sh +++ b/scripts/setup-benchmark.sh @@ -11,20 +11,20 @@ if [ "$EUID" -ne 0 ]; then fi # Really discourage swapping to disk -sudo sysctl vm.swappiness=0 +sysctl vm.swappiness=0 # Disable ASLR - https://docs.kernel.org/admin-guide/sysctl/kernel.html#randomize-va-space -sudo sysctl kernel.randomize_va_space=0 +sysctl kernel.randomize_va_space=0 # Reduce kernel logging to minimum dmesg -n 1 # Disable some unused services and features -sudo systemctl stop apparmor ModemManager -sudo systemctl disable apparmor ModemManager +systemctl stop apparmor ModemManager +systemctl disable apparmor ModemManager # mask prevents them from being started by other services -sudo systemctl mask ModemManager +systemctl mask ModemManager # For apparmor specifically, also teardown loaded profiles -sudo aa-teardown +aa-teardown