diff options
author | Arnstein Ressem <aressem@gmail.com> | 2021-08-21 09:29:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-21 09:29:27 +0200 |
commit | 5c652aebfc8d5cf5328ff478e1cedae310b68b78 (patch) | |
tree | 9df9a854d3a517da30f2dee368787ff92342dd21 /container-disc | |
parent | 2082c8e9ec91838954e223584cfddfcf1ca9d575 (diff) |
Revert "Reapply "Fail Vespa startup if no numactl .""
Diffstat (limited to 'container-disc')
-rwxr-xr-x | container-disc/src/main/sh/vespa-start-container-daemon.sh | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/container-disc/src/main/sh/vespa-start-container-daemon.sh b/container-disc/src/main/sh/vespa-start-container-daemon.sh index a0cbd9d9186..223124c29d6 100755 --- a/container-disc/src/main/sh/vespa-start-container-daemon.sh +++ b/container-disc/src/main/sh/vespa-start-container-daemon.sh @@ -110,8 +110,27 @@ configure_cpu() { } configure_numactl() { - numactlcmd=$(get_numa_ctl_cmd) - log_message debug "starting ${VESPA_SERVICE_NAME} for ${VESPA_CONFIG_ID} with numactl command : $numactlcmd" + log_message debug "starting ${VESPA_SERVICE_NAME} for ${VESPA_CONFIG_ID}" + if numactl --interleave all true &> /dev/null; then + # We are allowed to use numactl + numnodes=$(numactl --hardware | + grep available | + awk '$3 == "nodes" { print $2 }') + if [ "$VESPA_AFFINITY_CPU_SOCKET" ] && + [ "$numnodes" -gt 1 ] + then + node=$(($VESPA_AFFINITY_CPU_SOCKET % $numnodes)) + log_message debug "with affinity to $VESPA_AFFINITY_CPU_SOCKET out of $numnodes cpu sockets" + numactlcmd="numactl --cpunodebind=$node --membind=$node" + else + log_message debug "with memory interleaving on all nodes" + numactlcmd="numactl --interleave all" + fi + else + log_message debug "without numactl (no permission or not available)" + numactlcmd="" + fi + log_message debug "numactlcmd: $numactlcmd" } configure_gcopts() { |