使用systemd内置的cgroup对资源进行控制
systemctl show xxx.service来获取,也可以通过systemctl set-property xxx.service MemoryMax=30G来进行实时配置并写入文件,其中如果不支持的参数,此处会报错。systemd是cgroup的推荐配置方法,除此之外可以直接在cgroup配置文件中新建策略,通过添加pid的方式进行生效(/sys/fs/cgroup/cpu/test/xxx)systemd的service文件中支持的命令可以通过。控制cpu使用率(消耗的cpu)
原创
2024-04-28 16:19:18 ·
573 阅读 ·
0 评论