Last active
December 11, 2018 01:33
-
-
Save arleighdickerson/eb39a268dda83c44c8008902bed33658 to your computer and use it in GitHub Desktop.
set all cpu governers to performance mode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# sudo apt-get install cpufrequtils | |
if [[ $EUID -ne 0 ]]; then | |
echo "sudo me" | |
exit 1 | |
fi | |
command -v cpufreq-info >/dev/null 2>&1 || { echo >&2 "cpufrequtils not found"; exit 1; } | |
cores(){ | |
cat /proc/cpuinfo | grep processor | wc -l | |
} | |
eval "COUNTER=$(cores)" | |
until [ $COUNTER -lt 1 ]; do | |
let COUNTER-=1 | |
eval "cpufreq-set -g performance -c ${COUNTER}" | |
done | |
cpufreq-info | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment