当前位置:网站首页>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

边栏推荐
- P3250 [hnoi2016] Network + [necpc2022] f.tree path tree section + segment tree maintenance heap
- 2022年中南大学夏令营面试经验
- Spl06-007 air pressure sensor (example of barometer)
- Numpy np.max和np.maximum实现relu函数
- ASP.NET-酒店管理系统
- Linear table sequence table comprehensive application problem p18
- Understand go language context in one article
- C language log base zlog basic use
- Phpcms prompt message page Jump showmessage
- Google Earth engine (GEE) - ghsl global population grid dataset 250 meter resolution
猜你喜欢

Qt+VTK+OCCT读取IGES/STEP模型

836. 合并集合(DAY 63)并查集

Leetcode 46: full arrangement

解决msvcp120d.dll和msvcr120d.dll缺失

This article explains the complex relationship between MCU, arm, MCU, DSP, FPGA and embedded system

Slam mapping and autonomous navigation simulation based on turnlebot3

C language AES encryption and decryption

软件测试周刊(第78期):你对未来越有信心,你对现在越有耐心。

ASP. Net hotel management system

聊聊Flink框架中的状态管理机制
随机推荐
GCC compilation process and dynamic link library and static link library
Xml的(DTD,xml解析,xml建模)
R language uses data The table package performs data aggregation statistics, calculates window statistics, calculates the median of sliding groups, and merges the generated statistical data into the o
Linear table sequence table comprehensive application problem p18
Yintai department store ignites the city's "night economy"
Web安全总结
C language AES encryption and decryption
ASP. Net hotel management system
Encapsulate a koa distributed locking middleware to solve the problem of idempotent or repeated requests
ORACLE进阶(一) 通过EXPDP IMPDP命令实现导dmp
多维度监控:智能监控的数据基础
R language ggplot2 visualization: gganimate package creates dynamic line graph animation (GIF) and uses transition_ The reveal function displays data step by step along a given dimension in the animat
ASP.NET-酒店管理系统
Excel quick cross table copy and paste
Cadence background color setting
简单工厂和工厂方法模式
CSRF
Nestjs配置服务,配置Cookie和Session
并发编程-单例
.\vmware-vdiskmanager.exe -k “c:\\xxxxx.vmdk”