diff --git a/scripts/server_quiesce.sh b/scripts/server_quiesce.sh new file mode 100755 index 0000000..d70dca3 --- /dev/null +++ b/scripts/server_quiesce.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +set -x +set -e + +# This script is not general purpose, modify for your needs +# All the changes are temporary and go away on boot +# ref: https://llvm.org/docs/Benchmarking.html + +# Set performance governor +for i in 0 1 2 3 4 5 6 7 +do + echo "performance" | sudo tee /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor +done + + +# Remove effects of SMT +echo "off" | sudo tee /sys/devices/system/cpu/smt/control + +# Disable turbo boosting +for cpu_no in 0 1 2 3 4 5 6 7 +do + echo 3000000 | sudo tee /sys/devices/system/cpu/cpufreq/policy$cpu_no/scaling_max_freq +done + +# Disable ASLR +echo 0 | sudo tee /proc/sys/kernel/randomize_va_space diff --git a/scripts/server_unquiesce.sh b/scripts/server_unquiesce.sh new file mode 100755 index 0000000..3e72b00 --- /dev/null +++ b/scripts/server_unquiesce.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -x +set -e + +# Switch back performance governor +for i in 0 1 2 3 4 5 6 7 +do + echo "powersave" | sudo tee /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor +done + + +# Enable SMT +echo "on" | sudo tee /sys/devices/system/cpu/smt/control + + +# Enable max turbo frequencies +for cpu_no in 0 1 2 3 4 5 6 7 +do + echo 5389000 | sudo tee /sys/devices/system/cpu/cpufreq/policy$cpu_no/scaling_max_freq +done + +# Enable ASLR +echo 2 | sudo tee /proc/sys/kernel/randomize_va_space