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
 

cgroup之cpu关键参数的更多相关文章

  1. 【摘录】JAVA内存管理-有关垃圾收集的关键参数

    第八章 有关垃圾收集的关键参数 一些命令行参数可以用来选择垃圾收集器,指定堆或代的大小,修改垃圾收集行为,获取垃圾收集统计数据.本章给出一些最常用的参数.有关各种各样参数更多完整的列表和详细信息可以参 ...

  2. zabbix Server 4.0监控Flume关键参数

    zabbix Server 4.0监控Flume关键参数 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. Flume本身提供了http, ganglia的监控服务.当然我们也可以使用 ...

  3. Javascript中关键参数this浅析

    自从接触javascript以来,对this参数的理解一直是模棱两可.虽有过深入去理解,但却也总感觉是那种浮于表面,没有完全理清头绪. 但对于this参数,确实会让人产生很多误解.那么this参数到底 ...

  4. JVM内存模型和关键参数设置

    一. JVM内存模型: Jvm内存模型是学好Java很重要的一部分,该部分学习能让我们在系统运维的时候,或者优化服务器的时候能够有方法,懂原理. 二. Jvm关键参数: 1. 堆大小设置参数: -Xm ...

  5. MySQL数据库性能优化的关键参数(转)

    我们在进行数据库管理和开发中经常会遇到性能问题,这就涉及到MySQL的性能优化.通过在网络上查找资料和笔者自己的尝试,我认为以下系统参数是比较关键的: 关键参数一:back_log 要求 MySQL ...

  6. A Byte of Python 笔记(5)函数:定义、形参、局部变量、默认参数、关键参数

    第7章  函数 函数是重要的程序段.它们允许你给一块语句一个名称,然后你可以在程序的任何地方使用这个名称任意多次地运行这个语句块.这被称为 调用 函数. 定义函数 函数通过 def 关键字定义.def ...

  7. mysql的"双1设置"-数据安全的关键参数(案例分享)

    mysql的"双1验证"指的是innodb_flush_log_at_trx_commit和sync_binlog两个参数设置,这两个是是控制MySQL 磁盘写入策略以及数据安全性 ...

  8. MySQL数据库详解之"双1设置"的数据安全的关键参数案例分享

    mysql的"双1验证"指的是innodb_flush_log_at_trx_commit和sync_binlog两个参数设置,这两个是是控制MySQL 磁盘写入策略以及数据安全性 ...

  9. angular-cli.json配置参数解释,以及依稀常用命令的通用关键参数解释

    一. angular-cli.json常见配置 { "project": { "name": "ng-admin", //项目名称 &quo ...

随机推荐

  1. Python数学建模系列(一):规划问题之线性规划

    @ 目录 前言 线性规划 样例1:求解下列线性规划问题 scipy库求解 样例2:求解下列线性规划问题 pulp库求解 样例3.运输问题 说明 结语 前言 Hello!小伙伴! 非常感谢您阅读海轰的文 ...

  2. 【力扣leetcode】-787. K站中转内最便宜的航班

    题目描述: 有 n 个城市通过一些航班连接.给你一个数组 flights ,其中 flights[i] = [fromi, toi, pricei] ,表示该航班都从城市 fromi 开始,以价格 p ...

  3. 题解 Prime

    传送门 考场上魔改了一下线性筛,觉得要筛到 \(\frac{R}{2}\) 就没让它跑 其实正解就是这样,只不过由于接下来类似埃氏筛的过程只要筛到根号就行了 线性筛有的时候其实并不需要筛到 \(\fr ...

  4. Azkaban入门(启动一个Simple Example)

    Azkaban简介 azkaban是一个开源的任务调度系统 Azkaban是一套简单的任务调度服务,整体包括三部分webserver.dbserver.executorserver. 开发语言为Jav ...

  5. 【微服务技术专题】Netflix动态化配置服务-微服务配置组件变色龙Archaius

    前提介绍 如果要设计开发一套微服务基础架构,参数化配置是一个非常重要的点,而Netflix也开源了一个叫变色龙Archaius的配置中心客户端,而且Archaius可以说是比其他客户端具备更多生产级特 ...

  6. 【springboot】过滤器、监听器、拦截器,Aspect切片

    转自: https://blog.csdn.net/cp026la/article/details/86501019 简介: 本章介绍拦截器.过滤器.切片对请求拦截的使用与区别,以及监听器在 spri ...

  7. IO异常--缓冲流--转换流--序列化流( IO流2 )

    1.IO异常的处理 JDK7前处理:使用try...catch...finally 代码块,处理异常部分 // 声明变量 FileWriter fw = null; try { //创建流对象 fw ...

  8. 老鼠走迷宫II

    转自:http://blog.csdn.net/holymaple/article/details/8636234 由于迷宫的设计,老鼠走迷宫的入口至出口路径可能不止一条,如何求出所有的路径呢? 解法 ...

  9. Ubuntu中配置tomcat

    1.从网上下载的tomcat配置失败后,servername那一栏写不了,必须要删除工作空间的配置文件 sudo rm /home/{username}/workspace/.metadata/.pl ...

  10. 你的域名是如何变成 IP 地址的?

    我的 个人网站 上线了,上面可以更好的检索历史文章,并且可以对文章进行留言,欢迎大家访问 可能大家都知道或者被问过一个问题,那就是很经典的「从浏览器输入 URL 再到页面展示,都发生了什么」.这个问题 ...