全过程记录表
#添加cgroup
sudo yum install libcgroup-tools libcgroup-pam libcgroup
#设置cgroup服务开机启动
sudo systemctl enable cgconfig
#Created symlink from /etc/systemd/system/sysinit.target.wants/cgconfig.service to /usr/lib/systemd/system/cgconfig.service.
sudo systemctl enable cgred
#Created symlink from /etc/systemd/system/multi-user.target.wants/cgred.service to /usr/lib/systemd/system/cgred.service.
#编辑/etc/cgconfig.conf
sudo vim /etc/cgconfig.conf
#线程设置为70
group cpu_limit{
cpu{
cpu.cfs_period_us=100000;
cpu.cfs_quota_us=7000000;
}
}
#编辑/etc/cgrules.conf
sudo vim /etc/cgrules.conf
#
#<user> <controllers> <destination>
* cpu cpu_limit
#
#重启服务:
sudo systemctl restart cgconfig
sudo systemctl restart cgred