我在 CentOS 7.4 服务器上,并尝试设置 CGroups。
我的 cgconfig 如下所示:
#
# Copyright IBM Corporation. 2007
#
# Authors: Balbir Singh <[email protected]>
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2.1 of the GNU Lesser General Public License
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it would be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
#
# By default, we expect systemd mounts everything on boot,
# so there is not much to do.
# See man cgconfig.conf for further details, how to create groups
# on system boot using this file.
#
mount {
cpuset = /cgroup/cpuset;
}
group businesspro {
cpu {
cpu.shares="500";
}
}
group startup {
cpuset {
cpuset.mems="0";
cpuset.cpus="0";
}
}
和 cgrules.conf:
# /etc/cgrules.conf
#The format of this file is described in cgrules.conf(5)
#manual page.
#
# Example:
#<user> <controllers> <destination>
#@student cpu,memory usergroup/student/
#peter cpu test1/
#% memory test2/
# End of file
#
@watchdra cpu businesspro/
*:iscsid net_prio cgdcb-4-3260
dramafor cpuset cpuset:/startup/
现在我想做的是将所有进程移到带有控制器的dramafor
cgroup 中。我已经创建了它并重新启动了 cgconfig ,但文件是空的。我甚至不知道如何开始调试它。有人能告诉我出了什么问题吗,或者至少告诉我如何调试这种情况?startup
cpuset
cgred
services
startup/tasks
答案1
好的,我找到了答案。在我的 cgred 中,我必须这样做,/startup
而不是cpuset:/startup
对于遇到同样问题的人,简单的语法错误