mirror of
https://github.com/eliasstepanik/ark-ac-server-tools.git
synced 2026-01-11 10:38:27 +00:00
Add arkCpuAffinity setting
This commit is contained in:
parent
992baeb23a
commit
60465a178a
@ -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`::
|
||||
|
||||
@ -1030,15 +1030,23 @@ doStart() {
|
||||
echo "The server is starting..."
|
||||
|
||||
local pid=$!
|
||||
if [ -n "$arkPriorityBoost" ]; then
|
||||
if [[ -n "$arkPriorityBoost" || -n "$arkCpuAffinity" ]]; then
|
||||
doRun --wait </dev/null >>"$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 </dev/null >>"$logdir/$arkserverLog" 2>&1 & # output of this command is logged
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user