mirror of
https://github.com/eliasstepanik/ark-ac-server-tools.git
synced 2026-01-26 08:18: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.
|
Negative values give a higher priority, and positive values give a lower priority.
|
||||||
Requires `sudo` and `renice`
|
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`::
|
`msgWarnUpdateMinutes`::
|
||||||
`msgWarnUpdateSeconds`::
|
`msgWarnUpdateSeconds`::
|
||||||
`msgWarnRestartMinutes`::
|
`msgWarnRestartMinutes`::
|
||||||
|
|||||||
@ -1030,15 +1030,23 @@ doStart() {
|
|||||||
echo "The server is starting..."
|
echo "The server is starting..."
|
||||||
|
|
||||||
local pid=$!
|
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
|
doRun --wait </dev/null >>"$logdir/$arkserverLog" 2>&1 & # output of this command is logged
|
||||||
local pid="$!"
|
local pid="$!"
|
||||||
|
|
||||||
# Wait for monitor process to suspend itself
|
# Wait for monitor process to suspend itself
|
||||||
wait
|
wait
|
||||||
|
|
||||||
echo "Boosting priority of ark server"
|
if [ -n "$arkPriorityBoost" ]; then
|
||||||
sudo renice -n "$arkPriorityBoost" "$pid"
|
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"
|
kill -CONT "$pid"
|
||||||
else
|
else
|
||||||
doRun </dev/null >>"$logdir/$arkserverLog" 2>&1 & # output of this command is logged
|
doRun </dev/null >>"$logdir/$arkserverLog" 2>&1 & # output of this command is logged
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user