mdt-dialout-collector icon indicating copy to clipboard operation
mdt-dialout-collector copied to clipboard

install.sh vcpu count has issues in Kubernetes/OpenShift

Open sgaragan opened this issue 9 months ago • 3 comments

When running the install.sh script, it determines the number of vCPUs by the following line:

readonly available_vcpu=$(egrep 'processor' /proc/cpuinfo | wc -l)

Later in the script, the value is used to determine the number of jobs to run for the 'make' command:

make -j`echo $((${available_vcpu} - 1))`

When running in Kubernetes/OpenShift, "egrep 'processor' /proc/cpuinfo | wc -l" gives the total number of processors on the node running the build as /proc/cpuinfo is not scoped by cgroup. The result is that it runs with as many jobs as there are cores (in our case, 72) which blows the RAM usage through the roof.

I was able to fix this by changing the value to 2 manually in the Dockerfile but if this could be added as an argument to install.sh (or available to override via an env variable) that would allow the build to work more effectively in a k8s-based environment

Thanks, Sean

sgaragan avatar May 07 '24 17:05 sgaragan