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 ...
随机推荐
- axios 请求数据跳转页面报'$router' of undefined问题
代码: this.$axios.post("/auth", { 'username': this.username, 'password': this.password }).th ...
- C# Monitor.Wait() 源码追踪 (转载)
source: 释放对象上的锁并阻止当前线程,直到它重新获取该锁. 如果已用指定的超时时间间隔,则线程进入就绪队列. 可以在等待之前退出同步上下文的同步域,随后重新获取该域. [SecuritySaf ...
- redis知识点及常见面试题
redis知识点及常见面试题 参考: https://zm8.sm-tc.cn/?src=l4uLj4zF0NCIiIjRnJGdk5CYjNGckJLQrIqNiZaJnpOWjIvQno2Llpy ...
- vue开发:前端项目模板
简介 vue-cli创建vue项目,整合vuex.vue-router.axios.element-ui 项目模板下载地址 创建项目 使用vue-cli创建项目,功能选择:Babel.Router.v ...
- 30 道 Vue 面试题,内含详细讲解(涵盖入门到精通,自测 Vue 掌握程度)
前言 本文以前端面试官的角度出发,对 Vue 框架中一些重要的特性.框架的原理以问题的形式进行整理汇总,意在帮助作者及读者自测下 Vue 掌握的程度.本文章节结构以从易到难进行组织,建议读者按章节顺序 ...
- 3k+2形式的素数相关的两个命题的证明
- 2021年哪个低代码平台更值得关注?T媒体盘点国内主流低代码厂商
2020年圣诞前夜,国内知名创投科技媒体T媒体旗下的T研究发布了2020中国低代码平台指数测评报告.报告除了对国内低代码行业现状进行总结外,还对主流低代码厂商的市场渗透和曝光进行测评. 报告认为,低代 ...
- maven下载出错
求解
- nginx简介,使用
nginx是什么 nginx是一个开源的,支持高性能,高并发的www服务和代理服务软件. 支持高并发,能支持几万并发连接 资源消耗少,在3万并发连接下开启10个nginx线程消耗的内存不到200M 可 ...
- Djangoform组件——ModelForm的基本使用
from django.contrib import admin from django.urls import path from app01 import views urlpatterns = ...