I would like to run two containers with the following resource allocation:
- Container "C1": cpu1 reserved, shared cpu2 with 20 cpu-share.
- Container "C2": cpu3 reserved, shared cpu2 with 80 cpu-share.
If I run two containers as follows:
docker run -d --name='C1' --cpu-shares=20 --cpuset-cpus="1,2" progrium/stress --cpu 2 docker run -d --name='C2' --cpu-shares=80 --cpuset-cpus="2,3" progrium/stress --cpu 2
I realized that C1 accepts 100% cpu1 as expected, but 50% cpu2 (instead of 20%), C2 accepts 100% cpu3 as expected, and 50% cpu2 (instead of 80%).
It seems that the -cpu-shares option is ignored. Is there a way to get the behavior I'm looking for?
source share