Skip to content

Commit

Permalink
OCPBUGS-13153: Limit the value of GOMAXPROCS on node-exporter.
Browse files Browse the repository at this point in the history
xxxxx

Signed-off-by: Ayoub Mrini <amrini@redhat.com>
  • Loading branch information
machine424 committed Jun 12, 2023
1 parent 076da3b commit 7d40749
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions assets/node-exporter/daemonset.yaml
Expand Up @@ -41,6 +41,18 @@ spec:
- --collector.cpu.info
- --collector.textfile.directory=/var/node_exporter/textfile
- --no-collector.btrfs
command:
- /bin/sh
- -c
- |
export GOMAXPROCS=4
# We don't take CPU affinity into account as the container dones't have integer CPU requests
NUM_CPUS=$(grep -c '^processor' "/proc/cpuinfo" 2>/dev/null || echo "0")
if [ "$NUM_CPUS" -lt "$GOMAXPROCS" ]; then
export GOMAXPROCS="$NUM_CPUS"
fi
echo "Set GOMAXPROCS=$GOMAXPROCS"
exec /bin/node_exporter "$0" "$@"
image: quay.io/prometheus/node-exporter:v1.5.0
name: node-exporter
resources:
Expand Down

0 comments on commit 7d40749

Please sign in to comment.