Remove tune-system.sh script and its use (#7278)

This commit is contained in:
Pankaj Garg 2019-12-04 16:40:12 -08:00 committed by GitHub
parent 9d7a926a8b
commit c7932b710c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 53 deletions

View File

@ -60,11 +60,6 @@ while [[ -n $1 ]]; do
fi
done
if [[ -z $CI ]]; then # Skip in CI
# shellcheck source=scripts/tune-system.sh
source "$here"/../scripts/tune-system.sh
fi
# These keypairs are created by ./setup.sh and included in the genesis config
identity_keypair=$SOLANA_CONFIG_DIR/bootstrap-leader/identity-keypair.json
vote_keypair="$SOLANA_CONFIG_DIR"/bootstrap-leader/vote-keypair.json

View File

@ -217,11 +217,6 @@ else
program=$solana_validator
fi
if [[ -z $CI ]]; then # Skip in CI
# shellcheck source=scripts/tune-system.sh
source "$here"/../scripts/tune-system.sh
fi
set -e
PS4="$(basename "$0"): "

View File

@ -1,43 +0,0 @@
# |source| this file
#
# Adjusts system settings for optimal validator performance
#
sysctl_write() {
declare name=$1
declare new_value=$2
# Test the existence of the sysctl before trying to set it
sysctl "$name" 2>/dev/null 1>/dev/null || return 0
declare current_value
current_value=$(sysctl -n "$name")
[[ $current_value != "$new_value" ]] || return 0
declare cmd="sysctl -w $name=$new_value"
if [[ -n $SUDO_OK ]]; then
cmd="sudo $cmd"
fi
echo "$ $cmd"
$cmd || true
# Some versions of sysctl exit with 0 on permission denied errors
current_value=$(sysctl -n "$name")
if [[ $current_value != "$new_value" ]]; then
echo "==> Failed to set $name. Try running: \"SUDO_OK=1 source ${BASH_SOURCE[0]}\""
fi
}
case $(uname) in
Linux)
# Reference: https://medium.com/@CameronSparr/increase-os-udp-buffers-to-improve-performance-51d167bb1360
sysctl_write net.core.rmem_max 134217728
sysctl_write net.core.rmem_default 134217728
sysctl_write net.core.wmem_max 134217728
sysctl_write net.core.wmem_default 134217728
;;
*)
;;
esac