lxc - docker的一个容器可以跑满物理机的CPU吗
黄舟
黄舟 2017-04-21 11:16:37
0
5
1061

假设一台物理机上跑了3个容器,启动的时候分配的cpu share是一样的,那如果在一个容器满负载,而另外两个空闲的情况下,那单个容器有可能跑满物理机的CPU吗,还是说撑死只能跑到30%?

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(5)
Ty80

If docker is running a python process, a single process can run a single core (limited by GIL). In fact, looking at the process list, you will know that unlike vagrant, the docker process itself is integrated into the system process.

刘奇

Watch your progress

docker-proxy -proto tcp 

How much CPU can it occupy

Oh, if you use share, then the process will be tied to this core.
Also, if you use top to see, you can see that the process is 100%, but this 100% is 100% on this core
If you run with 3 cores, it will be 300%

左手右手慢动作

Even if you allocate the same cpu share to each container when starting. When the other two containers are idle, the remaining containers can still fill up the entire core.

cpu share gives me the feeling that it limits the lower limit of the container’s cpu usage. If you want to limit the upper limit of cpu usage, you need to modify the settings of the container through cgroup.

左手右手慢动作

This is an interesting question, I should try it as an experiment.

Peter_Zhu

Who is going to do the experiment and write a loop to fill up the processor?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template