当前位置:网站首页>CGroup introduction
CGroup introduction
2022-07-03 11:51:00 【InfoQ】
- What is? cgroups ?
- Why cgroups ?
- cgroups How did it happen ?
- How to use cgroups ?
1 What is? cgroups ?
2 Why cgroups?
echo pid > /sys/fs/cgroup/network/<new_class>/tasks
3 cgroup How is it realized ?
- Each task points to a css_set Structure pointer .
- One css_set Contains a series of points cgroup_subsys_state Pointer to structure , Every cgroup_subsys_state Corresponding to one cgroup subsystem.
- cgroup hierarchy Files can be mounted and browsed 、 Execute user mode operation .
- see cgroup Under all the tasks PID.
- tasks: A series of pids. Process ID Writing this file will move it to this cgroup.
- cgroup.procs: A series of process groups IDs. Group processes ID Writing this file will move it to this cgroup.
- notify_on_release flag: Whether to run release agent?
- release_agent: The path used to publish the notification ( This file exists only at the top cgroup)

4 How to use cgroups ?
## Limit cpu、mem Use
cd /sys/fs/cgroup/cpu_mem_cg
mkdir cg2
cd cg2
/bin/echo 2-3 > cpuset.cpus
/bin/echo 1 > cpuset.mems
/bin/echo 51565 > tasks
## Limit net Use
cd /sys/fs/cgroup/net/cg3
/bin/echo 51565 > tasks

边栏推荐
- Vulnhub geminiinc
- 解决msvcp120d.dll和msvcr120d.dll缺失
- Software testing weekly (issue 78): the more confident you are about the future, the more patient you are about the present.
- Xiaopeng P7 hit the guardrail and the airbag did not pop up. The official responded that the impact strength did not meet the ejection requirements
- Kubernetes 三打探针及探针方式
- Based on MCU, how to realize OTA differential upgrade with zero code and no development?
- R语言使用aggregate函数计算dataframe数据分组聚合的均值(sum)、不设置na.rm计算的结果、如果分组中包含缺失值NA则计算结果也为NA
- Excel quick cross table copy and paste
- 利用Zabbix动态监控磁盘I/O
- Redis things
猜你喜欢
外插散点数据
Hongmeng fourth training
导师对帮助研究生顺利完成学业提出了20条劝告:第一,不要有度假休息的打算.....
PHP server interacts with redis with a large number of close_ Wait analysis
After using the thread pool for so long, do you really know how to reasonably configure the number of threads?
vulnhub之Nagini
银泰百货点燃城市“夜经济”
AI模型看看视频,就学会了玩《我的世界》:砍树、造箱子、制作石镐样样不差...
uniapp scroll view 解决高度自适应、弹框滚动穿透等问题。
STL tutorial 10 container commonalities and usage scenarios
随机推荐
ftp登录时,报错“530 Login incorrect.Login failed”
Sheet1$. Output [excel source output] Error in column [xxx]. The returned column status is: "the text is truncated, or one or more characters have no matches in the target code page.".
vulnhub之narak
Some common terms
Web安全总结
mysql使用update联表更新的方法
抓包整理外篇fiddler———— 会话栏与过滤器[二]
The tutor put forward 20 pieces of advice to help graduate students successfully complete their studies: first, don't plan to take a vacation
Cadence background color setting
XML (DTD, XML parsing, XML modeling)
vulnhub之cereal
repo ~ 常用命令
C language AES encryption and decryption
Ripper of vulnhub
Test classification in openstack
836. Merge sets (day 63) and search sets
Kubernetes 三打探针及探针方式
Unity3D学习笔记5——创建子Mesh
How to make others fear you
量化计算调研