Files
scylladb/dist/common/scripts/scylla_cpuset_setup
Takuya ASADA 49cdd0b786 dist: move '--cpuset' and '--smp' configuration to scylla_cpuset_setup / cpuset.conf
These parameters are only required for AMI, not for non-AMI environment which want to enable SET_NIC, so split them to indivisual script / conf file, call it from AMI install script.
2016-05-19 06:25:28 +09:00

43 lines
788 B
Bash
Executable File

#!/bin/bash -e
#
# Copyright (C) 2016 ScyllaDB
print_usage() {
echo "scylla_cpuset_setup --cpuset 1-7 --smp 7"
echo " --cpuset CPUs to use (in cpuset(7) format; default: all))"
echo " --smp number of threads (default: one per CPU)"
exit 1
}
CPUSET=
SMP=
while [ $# -gt 0 ]; do
case "$1" in
"--cpuset")
CPUSET=$2
shift 2
;;
"--smp")
SMP=$2
shift 2
;;
*)
print_usage
;;
esac
done
if [ "$CPUSET" = "" ] && [ "$SMP" = "" ]; then
print_usage
fi
OUT="CPUSET=\""
if [ "$CPUSET" != "" ]; then
OUT="$OUT--cpuset $CPUSET "
fi
if [ "$SMP" != "" ]; then
OUT="$OUT--smp $SMP "
fi
OUT="$OUT\""
echo $OUT > /etc/scylla.d/cpuset.conf