Environment variable set to the number of available CPU's

I can’t speak to the other executors, but I was able to determine the number of “vCPUs” available in my docker executor environment by inspecting cgroup configuration:

echo $(($(cat /sys/fs/cgroup/cpu/cpu.shares) / 1024))

Of course, it would be much nicer to have this info exposed through /proc or at least as an environment variable.

1 Like