on-internet
← Community

How to determine the number of constrained CPUs within a Docker container? For use with make -j

Stack Overflow ·

Docker supports a --cpus option which constrains a container to using a certain proportion of the host's computing resource. For example, --cpus 2.5 will allocate computing resource equivalent to approximately two and a half of the host's CPU capability. This allocation seems to be somewhat "logical" rather than physical, in that a container running eight processes but with --cpus 1.0 tends to run each process on a separate CPU but limited to approximately 12.5%. This is fine, I suppose. The problem is that I am not able to find a way for a process within a constrained container to determine h

Comments

Sign in or sign up to comment and upvote.

No comments yet.