Questions tagged [cgroups]

cgroups are used to control resource management in kernel. They remain in an hierarchy and a new group can be created just by creating a directory in the appropriate place. Using cgroups, a lot of resource management can be done including memory, cpu etc.

cgroups (abbreviated from control groups) is a Linux kernel feature that limits, accounts for, and isolates the resource usage (CPU, memory, disk I/O, network, etc.) of a collection of processes.

369 questions
0
votes
0 answers

why does the numbers be reduced 256 when set memory.limit_in_bytes

the command snippet is as follow: sudo mkdir /sys/fs/cgroup/memory/demo cat /sys/fs/cgroup/memory/demo/memory.limit_in_bytes # output: 9223372036854771712 echo 100000000 > /sys/fs/cgroup/memory/demo/memory.limit_in_bytes cat…
iFurySt
  • 59
  • 5
0
votes
1 answer

How to properly create cgroup with bash script?

I'm trying to write init_cgroup.sh script, that will create container with specified in args limitations. As I understood, I need to find out the cgroup version at first, mount it, and then apply options to corresponding files Here is how I tried to…
ippishio
  • 1
  • 2
0
votes
0 answers

Limit Overall Memory of Multiple Simultaneous Processes of the Same Executable

I have an application that uses Imagemagick's convert utility to resize images. The application has an API exposed which executes a convert command for each request. The application usually serves ~20 requests/s but can spike to upto 200/s. I want…
Swastik Gupta
  • 149
  • 1
  • 1
  • 12
0
votes
1 answer

Why Golang MADV_FREE leads to OOM sometimes?

We use the go1.12 and k8s deployment services. In the actual production environment, we have a project that has been OOM until container is killed. Through online survey, it is because Golang MADV_FREE , later we set to MADV_DONTNEED, the problem is…
xrui
  • 63
  • 2
0
votes
0 answers

Cannot load cgroup config in docker

I was trying to load my cgroup config with cgconfigparser, but it gives the following error: cgconfigparser; error loading /etc/cgconfig.conf: Cgroup is not mounted Then I tried grep cgroup /proc/mounts, which gives: cgroup2 /sys/fs/cgroup cgroup2…
instant501
  • 195
  • 1
  • 10
0
votes
0 answers

The ebpf program(sockops) does not take effective when attaching into a child cgroup

I wrote an ebpf code to set tos of ip header, it take effective when attaching into the root path (1/sys/fs/cgroup/unified1), but it does not take effective when attaching into the child cgroup such as /sys/fs/cgroup/unified/docker/ code: #include…
ethen_du
  • 1
  • 1
0
votes
0 answers

How to use cgroup v2 to limit memory and cpu per user group?

With cgroup v1, I can have group configuration in cgconfig.conf and assign groups to different users in cgrules.conf However, it seems to me that cgconfig and cgrules can't be used along with cgroup v2. The only way I know to use cgroup v2 is to…
Lei Yu
  • 199
  • 9
0
votes
0 answers

how cgroup limit the cpu usage in the docker

I am learning docker and read that the docker using cgroup to limit the resource usage, but I did not find out how the cgroup do the resource control. how does the cgroup control the resource usage? what algorithm does the cgroup use? I have tried…
spark
  • 663
  • 1
  • 5
  • 18
0
votes
1 answer

Error specifying --cgroup-parent for a control group

I want to create a control group for managing resources related to some system management functions. Some of these run in docker containers. When I run these docker containers, I'd like to be able to specify the cgroup into which they're…
0
votes
0 answers

Permission Denied to modify tasks and cpu.shares

As an experiment I was trying to add some processes in tasks and modify some cpu.shares. However I get Permission denied if I try to run commands like I created a folder test inside of /sys/fs/cgroup/cpu $ sudo -s $whoami root $ echo 2472 >…
Vipin Menon
  • 2,892
  • 4
  • 20
  • 35
0
votes
2 answers

CGROUP, Not found the cpu.weight in /sys/fs/cgroup/

I can't find /sys/fs/cgroup/cpu.weight, I only have cpu.pressure and cpu.stat and without the `cweight my minikube on docker doesn't work. How can I configure it? cat /sys/fs/cgroup/cgroup.controllers cpuset cpu io memory hugetlb pids rdma misc ls…
Miuler
  • 473
  • 1
  • 5
  • 13
0
votes
0 answers

How to know Memory cgroup limit?

We have kubernetes cluster, and we are running jenkins in it. Our jenkins restart after every 48 hours, when we check the kubelet logs for that worker where jenkins deployed, it gives error Feb 15 14:52:01 myworker kernel: Memory cgroup out of…
Nilesh
  • 20,521
  • 16
  • 92
  • 148
0
votes
1 answer

Docker multiple containers cgroup resource CPU MEM limitation

I'm using Ubuntu 21.10 and would like to restrict the system resources (CPU, MEM) for a subset of my docker containers - not for a particular container. How can I do that?
user2809176
  • 1,042
  • 12
  • 29
0
votes
0 answers

java-8 cgroup without UseCGroupMemoryLimitForHeap

This continues kind of this question I am making the same steps as there, but this time, I am dropping UseCGroupMemoryLimitForHeap: java -XX:InitialRAMPercentage=50.0 -XX:MaxRAMPercentage=50.0 -XX:+AlwaysPreTouch Dummy & And I am trying to inspect…
Eugene
  • 117,005
  • 15
  • 201
  • 306
0
votes
1 answer

RHEL 7: missing cgroup after reboot instances

I'm trying to limit resources by using cgroup. It's working fine until I reboot the instance. I had checked and found that the cgroup was removed for some reason. This is my step to creating the cgroup: # Create a cgroup mkdir…
KhanhND
  • 85
  • 1
  • 7