# 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
cgroups实验
推荐阅读
- Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zone. You must configure either the serv
- springboot整合mybatis,druid,mybatis-generator插件完整版
- springBoot整合Swagger2
- springboot自己实现mysql主从数据切换机制
- mysql中insert into select from的使用
- BigDecimal的操作工具类
- MQTT
- 唯一id
- java.nio.file.FileSystemException: D:\kafka_2.12-2.1.0\kafka_2.12-2.1.0\logs\__consumer_offsets-30\00000000000000000000.timeindex.cleaned: 另一个程序正在使用此文件,进程无法访问。
- 博文阅读密码验证 - 博客园