cgroup之cpu关键参数
cpu.cfs_period_us
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
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
.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
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
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
- they are hierarchical, and
- child cgroups inherit certain attributes from their parent cgroup.
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";
}
}
cgroup之cpu关键参数的更多相关文章
- 【摘录】JAVA内存管理-有关垃圾收集的关键参数
第八章 有关垃圾收集的关键参数 一些命令行参数可以用来选择垃圾收集器,指定堆或代的大小,修改垃圾收集行为,获取垃圾收集统计数据.本章给出一些最常用的参数.有关各种各样参数更多完整的列表和详细信息可以参 ...
- zabbix Server 4.0监控Flume关键参数
zabbix Server 4.0监控Flume关键参数 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. Flume本身提供了http, ganglia的监控服务.当然我们也可以使用 ...
- Javascript中关键参数this浅析
自从接触javascript以来,对this参数的理解一直是模棱两可.虽有过深入去理解,但却也总感觉是那种浮于表面,没有完全理清头绪. 但对于this参数,确实会让人产生很多误解.那么this参数到底 ...
- JVM内存模型和关键参数设置
一. JVM内存模型: Jvm内存模型是学好Java很重要的一部分,该部分学习能让我们在系统运维的时候,或者优化服务器的时候能够有方法,懂原理. 二. Jvm关键参数: 1. 堆大小设置参数: -Xm ...
- MySQL数据库性能优化的关键参数(转)
我们在进行数据库管理和开发中经常会遇到性能问题,这就涉及到MySQL的性能优化.通过在网络上查找资料和笔者自己的尝试,我认为以下系统参数是比较关键的: 关键参数一:back_log 要求 MySQL ...
- A Byte of Python 笔记(5)函数:定义、形参、局部变量、默认参数、关键参数
第7章 函数 函数是重要的程序段.它们允许你给一块语句一个名称,然后你可以在程序的任何地方使用这个名称任意多次地运行这个语句块.这被称为 调用 函数. 定义函数 函数通过 def 关键字定义.def ...
- mysql的"双1设置"-数据安全的关键参数(案例分享)
mysql的"双1验证"指的是innodb_flush_log_at_trx_commit和sync_binlog两个参数设置,这两个是是控制MySQL 磁盘写入策略以及数据安全性 ...
- MySQL数据库详解之"双1设置"的数据安全的关键参数案例分享
mysql的"双1验证"指的是innodb_flush_log_at_trx_commit和sync_binlog两个参数设置,这两个是是控制MySQL 磁盘写入策略以及数据安全性 ...
- angular-cli.json配置参数解释,以及依稀常用命令的通用关键参数解释
一. angular-cli.json常见配置 { "project": { "name": "ng-admin", //项目名称 &quo ...
随机推荐
- Blazor+Dapr+K8s微服务之开发环境调试
1 安装Dapr开发调试环境 1.1 Dapr 完整安装模式不支持开发调试 在上一篇随笔<Blazor+Dapr+K8s微服务之服务调用>中,我们通过为每个 ...
- NOIP 模拟 $19\; \rm v$
题解 一道概率与期望的状压题目 这种最优性的题目,我们一般都是倒着转移,因为它的选择是随机的所以我们无法判断从左还是从右更有,所以我们都搜一遍 时间一定会爆,采用记忆化搜索,一种状态的答案一定是固定的 ...
- docker配置cdn-容器内可以通过域名访问
添加docker的cdn配置 # 没有这个文件创建 vim /etc/docker/daemon.json 添加内容如下 { "dns":["8.8.8.8", ...
- Centos7上yum安装mongodb(安装epel中的版本可能会比较老)
yum install epel-release 搜索mongodb-server 安装mongodb yum install mongodb-server.x86_64 配置mongodb vim ...
- servlet防止表单重复提交
日常开发中,防表单重复提交是一项必须的工作 我们可以利用javascript防止表单重复提交,但是利用javascript防止表单重复提交会出现一个新的问题 因为某些用户可能会绕过script代码直接 ...
- 从0开始搭建一个IoC容器(C#版)
网址:https://blog.csdn.net/wangyahua1234/article/details/100619695 目录 1. IoC简介 2. Tiny版IoC的功能 3. Tiny版 ...
- 流媒体 Ubuntu部署srs、windows部署nginx
一.获取项目//码云克隆git clone https://gitee.com/winlinvip/srs.oschina.git srs//githubgit clone https://githu ...
- 【springcloud】Zuul高级配置(zuul--2)
转自:https://blog.csdn.net/pengjunlee/article/details/87162192 自定义路由规则 在<API Gateway 的路由和过滤(Zuul)&g ...
- 关于 java编程思想第五版 《On Java 8》
On Java 8中文版 英雄召集令 这是该项目的GITHUB地址:https://github.com/LingCoder/OnJava8 广招天下英雄,为开源奉献!让我们一起来完成这本书的翻译吧! ...
- win10 安装mysql5.7 【自定义安装路径】