Docker Community Forums

Share and learn in the Docker community.

Limiting the no. of CPUs the container can see

Hi,

Is there any way that i can limit the no. of cpus visible to the container?
I tried using the --cpuset-cpus set option, but the container is still seeing all the cpus of the host.
Any advise is appreciated
Thanks!

I have exactly the same questions!

To limit the maximum amount of memory usage for a container, add the --memory option to the docker run command. Alternatively, you can use the shortcut -m . Within the command, specify how much memory you want to dedicate to that specific container.

I’m talking about visibility that htop still sees all CPUs regardless of “usable” ones.

I’m running a super computer and allow users to use containers. These users shouldn’t see how powerful this super computer is, nor the total number of installed CPUs.