diff --git a/README.asciidoc b/README.asciidoc index 45ca324..c224142 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -407,6 +407,11 @@ The following options can be overridden on a per-instance basis: Negative values give a higher priority, and positive values give a lower priority. Requires `sudo` and `renice` +`arkCpuAffinity`:: + Attempts to set the CPU affinity of the ARK server. + Setting is a comma-delimited list of processor indices on which the server should run. + Requires `sudo` and `taskset` + `msgWarnUpdateMinutes`:: `msgWarnUpdateSeconds`:: `msgWarnRestartMinutes`:: diff --git a/tools/arkmanager b/tools/arkmanager index bcac987..9833d9c 100755 --- a/tools/arkmanager +++ b/tools/arkmanager @@ -1030,15 +1030,23 @@ doStart() { echo "The server is starting..." local pid=$! - if [ -n "$arkPriorityBoost" ]; then + if [[ -n "$arkPriorityBoost" || -n "$arkCpuAffinity" ]]; then doRun --wait >"$logdir/$arkserverLog" 2>&1 & # output of this command is logged local pid="$!" # Wait for monitor process to suspend itself wait - echo "Boosting priority of ark server" - sudo renice -n "$arkPriorityBoost" "$pid" + if [ -n "$arkPriorityBoost" ]; then + echo "Boosting priority of ark server" + sudo renice -n "$arkPriorityBoost" "$pid" + fi + + if [ -n "$arkCpuAffinity" ]; then + echo "Setting CPU affinity for ark server" + sudo taskset -c "$arkCpuAffinity" -p "$pid" + fi + kill -CONT "$pid" else doRun >"$logdir/$arkserverLog" 2>&1 & # output of this command is logged