当前位置:网站首页>cgroup简介
cgroup简介
2022-07-03 11:01:00 【InfoQ】
- 什么是cgroups ?
- 为什么需要cgroups ?
- cgroups是怎么实现的?
- 如何使用cgroups ?
1 什么是cgroups ?
2 为什么需要cgroups?
echo pid > /sys/fs/cgroup/network/<new_class>/tasks3 cgroup是如何实现的?
- 每个任务在系统中指向一个css_set结构体指针.
- 一个css_set 含有一系列指向cgroup_subsys_state结构体的指针, 每个cgroup_subsys_state对应一个cgroup subsystem.
- cgroup hierarchy 文件可以被挂载浏览、执行用户态操作.
- 查看cgroup下所有的任务PID.
- tasks: 一系列的pids. 将进程ID写入这个文件会将其移动到这个cgroup.
- cgroup.procs: 一系列的进程组IDs.将进程组ID写入这个文件会将其移动到这个cgroup.
- notify_on_release flag: 是否运行release agent?
- release_agent: 用于发布通知的路径(此文件仅存在于顶级 cgroup)

4 如何使用cgroups ?
## 限制cpu、mem使用
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
## 限制net使用
cd /sys/fs/cgroup/net/cg3
/bin/echo 51565 > tasks

边栏推荐
- 鸿蒙第三次培训(项目实训)
- After using the thread pool for so long, do you really know how to reasonably configure the number of threads?
- STL教程9-容器元素深拷贝和浅拷贝问题
- MySQL union和union all区别
- How to clean up v$rman_ backup_ job_ Details view reports error ora-02030
- VPP three-layer network interconnection configuration
- Linear table sequence table comprehensive application problem p18
- Gut | 香港中文大学于君组揭示吸烟改变肠道菌群并促进结直肠癌(不要吸烟)
- 并发编程-单例
- Mysql根据时间搜索常用方法整理
猜你喜欢

PHP基础

Kubernetes 三打探针及探针方式

活动预告 | 直播行业“内卷”,以产品力拉动新的数据增长点

Mmc5603nj geomagnetic sensor (Compass example)

00后抛弃互联网: 毕业不想进大厂,要去搞最潮Web3

The tutor put forward 20 pieces of advice to help graduate students successfully complete their studies: first, don't plan to take a vacation

ftp登录时,报错“530 Login incorrect.Login failed”

Use typora to draw flow chart, sequence diagram, sequence diagram, Gantt chart, etc. for detailed explanation

LeetCode 46:全排列

The uniapp scroll view solves the problems of high adaptability and bullet frame rolling penetration.
随机推荐
The excel table is transferred to word, and the table does not exceed the edge paper range
Redis things
FL Studio 20 unlimited trial fruit arranger Download
Phpcms prompt message page Jump showmessage
POI excel cell wrap
00后抛弃互联网: 毕业不想进大厂,要去搞最潮Web3
Application of high-precision indoor positioning technology in safety management of smart factory
uniapp scroll view 解决高度自适应、弹框滚动穿透等问题。
How to mix embedded MCU, arm and DSP?
C language two-dimensional array
MATLAB提取不规则txt文件中的数值数据(简单且实用)
ASP. Net hotel management system
[OBS] configFile in ini format of OBS
Nestjs配置服务,配置Cookie和Session
(2) Base
P3250 [HNOI2016] 网络 + [NECPC2022] F.Tree Path 树剖+线段树维护堆
MySQL union和union all区别
This article explains the complex relationship between MCU, arm, MCU, DSP, FPGA and embedded system
STL教程8-map
基于turtlebot3实现SLAM建图及自主导航仿真