# yum install -y libcgroup libcgroup-tools
创建控制组
cgcreate -g cpu:/test
cgcreate -g cpu:/test2

禁用quota
cgset -r cpu.cfs_quota_us=-1 test
cgset -r cpu.cfs_quota_us=-1 test2

设置权重
cgset -r cpu.shares=1024 test
cgset -r cpu.shares=1024 test2

# cat test.sh
#!/bin/sh
x=0
while [ True ];do
   x=$x+1
done;

测试
# cgexec -g cpu:/test ./test.sh
# cgexec -g cpu:/test2 ./test.sh
分别运行三组,cpu使用率是1:1
test设置成512
cpu使用率是1:2

相关文章:

  • 2021-09-22
  • 2021-09-25
  • 2022-12-23
  • 2021-08-16
  • 2021-10-19
  • 2021-04-07
  • 2021-06-20
  • 2021-07-13
猜你喜欢
  • 2022-01-12
  • 2022-01-22
  • 2021-09-07
  • 2021-12-27
  • 2021-10-27
  • 2021-09-06
相关资源
相似解决方案