summaryrefslogtreecommitdiffstats
path: root/container-disc
diff options
context:
space:
mode:
authorArnstein Ressem <aressem@gmail.com>2021-08-20 10:33:56 +0200
committerGitHub <noreply@github.com>2021-08-20 10:33:56 +0200
commitf1ff9b46c6d663e180840b048ba7e2dd65616d43 (patch)
tree3720f218858e9ffe384fa523f7f42112c10a1a0c /container-disc
parent4c97161ae4ac76bcb7a2753762c9e17c6447b636 (diff)
Revert "Fail Vespa startup if no numactl ."
Diffstat (limited to 'container-disc')
-rwxr-xr-xcontainer-disc/src/main/sh/vespa-start-container-daemon.sh23
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() {