为什么cn中的cpu.shares不是按照定义共享cpu的

时间:2016-08-31 14:57:39

标签: linux linux-kernel kernel cgroups

我在6台核心机上运行了以下命令

stress -c 10
dd if=/dev/zero of=/dev/null # 10 times

系统上的负载如下所示

without Cgroups

我创建了两个cgroup并将它们的pid添加到它们

for i in $(pidof stress |tr ' ' '\n' ); do echo $i > writelimit/tasks; done
for i in $(pidof dd |tr ' ' '\n' ); do echo $i > lowlimit/tasks; done

jabir@host /sys/fs/cgroup # cat writelimit/cpu.shares 
900
jabir@host /sys/fs/cgroup  # cat lowlimit/cpu.shares 
100

但是,随着这种变化,压力cmd的CPU%也显着下降

with Cgroups

我预计压力仍然会使用大部分CPU%和dd如图所示下降,什么导致压力也会下降?任何指针

仅供参考:我在虚拟环境中运行。

1 个答案:

答案 0 :(得分:0)

the issue was with cpuset.cpus, had only one cpu in each of the cpuset.cpus