CPU Configuration and Physical CPU Allocated

Hi all,
Can anyone point me how a docker container manage its physical resources, i.e. CPU? We can see in hyper-V, they have CPU groups for VMs, do we have some similar concept to that?

More specificly, if we configured 1.5 cpus for a container, what are the steps to assign 1.5 physical CPUs to the container?

Thanks,

Hello @zongshun96 ,

Hope this link may help you Runtime options with Memory, CPUs, and GPUs | Docker Documentation. Please refer, there both CPU and the memory assigning and usage is explained in detail.

regards,
Siddhartha V

1 Like

How can we know which vCPUs are assigned to which physical core? Would you like to mention more about how this assignment works internally?

It seems I can set --cpuset-cpus so my container use specific physical CPUs, but I cannot find how or whether multiplexing virtual CPUs over physical CPUs happens in this case.

Thanks,

Hi Siddhartha,
It looks like that pointer misses the discussion of how those APIs(options) works internally, i.e., --cpus=<value> says a container can use such amount of CPU cycles but doesn’t explain how those cycles are “distributed” among physical CPUs, --cpuset-cpus mentions which physical CPUs to use but doesn’t talk about if or how multiplexing of virtual CPU happens.

Would you like to send a pointer(s) that contains deeper information? Or maybe papers describing docker container architecture overall?

Thanks,
Zongshun