cpu.cfs_period_us

specifies a period of time in microseconds (µs, represented here as "us") for how regularly a cgroup's access to CPU resources should be reallocated. If tasks in a cgroup should be able to access a single CPU for 0.2 seconds out of every 1 second, set cpu.cfs_quota_us to 200000 and cpu.cfs_period_us to 1000000. The upper limit of the cpu.cfs_quota_us parameter is 1 second and the lower limit is 1000 microseconds.

cpu.cfs_quota_us

specifies the total amount of time in microseconds (µs, represented here as "us") for which all tasks in a cgroup can run during one period (as defined by cpu.cfs_period_us). As soon as tasks in a cgroup use up all the time specified by the quota, they are throttled for the remainder of the time specified by the period and not allowed to run until the next period. If tasks in a cgroup should be able to access a single CPU for 0.2 seconds out of every 1 second, set cpu.cfs_quota_us to 200000 and cpu.cfs_period_us to 1000000. Note that the quota and period parameters operate on a CPU basis. To allow a process to fully utilize two CPUs, for example, set cpu.cfs_quota_us to 200000 and cpu.cfs_period_us to 100000.
Setting the value in cpu.cfs_quota_us to -1 indicates that the cgroup does not adhere to any CPU time restrictions. This is also the default value for every cgroup (except the root cgroup).
 

SETTING PARAMETERS

cpu_and_mem]# cgset -r cpuset.cpus=0-1 group1

The values that you can set with cgset might depend on values set higher in a particular hierarchy. For example, if group1 is limited to use only CPU 0 on a system, you cannot set group1/subgroup1 to use CPUs 0 and 1, or to use only CPU 1.

cgcreate -g cpu,net_cls:/test-subgroup
 The cgcreate command creates two groups named test-subgroup, one in the cpu_and_mem hierarchy and one in the net hierarchy. The test-subgroup group in the cpu_and_mem hierarchy is controlled by the memory subsystem, even though it was not specified in the cgcreate command.
 

The Cgroup Model

Cgroups are similar to processes in that:
  • they are hierarchical, and
  • child cgroups inherit certain attributes from their parent cgroup.
Multiple separate hierarchies of cgroups are necessary because each hierarchy is attached to one or more subsystems. A subsystem[2] represents a single resource, such as CPU time or memory. Red Hat Enterprise Linux 6 provides ten cgroup subsystems, listed below by name and function.
 

Per-group CPU and memory resource management

In the /etc/cgconfig.conf file, configure the following subsystems to be mounted and cgroups to be created:

mount {
cpu = /cgroup/cpu_and_mem;
cpuacct = /cgroup/cpu_and_mem;
memory = /cgroup/cpu_and_mem;
} group finance {
cpu {
cpu.shares="250";
}
cpuacct {
cpuacct.usage="0";
}
memory {
memory.limit_in_bytes="2G";
memory.memsw.limit_in_bytes="3G";
}
} group sales {
cpu {
cpu.shares="250";
}
cpuacct {
cpuacct.usage="0";
}
memory {
memory.limit_in_bytes="4G";
memory.memsw.limit_in_bytes="6G";
}
} group engineering {
cpu {
cpu.shares="500";
}
cpuacct {
cpuacct.usage="0";
}
memory {
memory.limit_in_bytes="8G";
memory.memsw.limit_in_bytes="16G";
}
}
参考:
https://blog.csdn.net/zdy0_2004/article/details/54343384        --numa 架构
https://www.cnblogs.com/cenalulu/p/4358802.html   --  -numa 架构介绍
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html-single/resource_management_guide/index#sect-cfs  --rhel6
 

最新文章

  1. 第二章 搭建Android开发环境
  2. 数据存储之Cookie和Web Storage。
  3. e_msg_c_as_register_req-注册存储过程
  4. 将文件读取到内存、打印pe结构
  5. [转]BEHAVOUR TREE
  6. 黑马程序员_Java基本数据的自动拆装箱及享元设计模式视频学习笔记
  7. Winform使用DevExpress的WaitDialogForm画面 z
  8. 部分常见ORACLE面试题以及SQL注意事项
  9. Spring talk简单配置
  10. (转)在Android的webview中定制js的alert,confirm和prompt对话框的方法
  11. wp天气预报
  12. Chromium
  13. android jni——helloworld
  14. Java 八大类型、String和 StringBuffer
  15. Excel数据导入至Dataset中
  16. 从 RAID 到 Hadoop Hdfs 『大数据存储的进化史』
  17. syslog日志打印
  18. Android 方法数超过64k、编译OOM、编译过慢解决方案。
  19. geth工作运行程序转后台
  20. 使用 Ansible 统计服务器资源利用率

热门文章

  1. ASP.NET Core教程:ASP.NET Core使用AutoMapper
  2. WPF三维立体效果3D
  3. 防止XSS 攻击集成springboot
  4. ajax传字符串时出现乱码问题的解决
  5. 10.SpringMVC之格式化、校验
  6. new[]/delete[]与new/delete区别
  7. JDBC基础篇(MYSQL)——PreparedStatement执行DML、DQL等
  8. C#窗体间互相传值
  9. TCP连接中的状态
  10. Excel 列名转int索引(C#版)