Skip to content

Instantly share code, notes, and snippets.

@yasuoohno
Created December 21, 2019 03:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yasuoohno/7d813e88d1449ff83610620e35d26d80 to your computer and use it in GitHub Desktop.
Save yasuoohno/7d813e88d1449ff83610620e35d26d80 to your computer and use it in GitHub Desktop.
Tuned - Disable Transparent HugePages
{
CUSTOM_TUNED="disable-thp"
PROFILE_DIR="/etc/tuned/$CUSTOM_TUNED"
TUNED_CONF="$PROFILE_DIR/tuned.conf"
ACTIVE_PROFILE=`tuned-adm active | cut -d " " -f 4`
sudo mkdir -p "$PROFILE_DIR"
cat <<EOF | sudo tee "$TUNED_CONF"
[main]
include= $ACTIVE_PROFILE
[vm]
transparent_hugepages=never
EOF
sudo chmod +x "$TUNED_CONF"
sudo tuned-adm profile "$CUSTOM_TUNED"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment