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

How do I read the effective cgroups limits for the current process using /sys/fs/cgroup

I'm looking for the simplest recipe for reading the cgroups v1 and v2 effective values for CPU limits affecting my own process (using file system operations not OS commands). From the kernel docs and looking around I think the main steps are…
Ben Spiller
  • 477
  • 4
  • 12
0
votes
0 answers

io.max limit per process or sum of all processes in the group in cgroup v2 io controller

For example, configure io.max in cgroup A: 8:0 wbps=1024000 And the cgroup.procs has some processes: p1, p2, p3. So my question is: When p1, p2 and p3 write data to 8:0, the wbps of p1, p2, and p3 is 1024000 per process or the sum wbps of p1, p2,…
R.MT
  • 1
  • 1
0
votes
0 answers

Can we get resource usage of pod without metric server? If yes how? And how accurate is it compared to the kubectl top command

Basically I want to know if we can get resource usage values without using metrics server and if yes how.(Values obtained should be approx. same as obtained by kubectl top command) I tried getting resource usage by entering into the pod using "exec…
Aman
  • 1
  • 1
0
votes
0 answers

How to run Docker with Yocto on qemu without Internet connectivity?

On qemu, I'm trying to run Docker with Yocto project and there isn't any network connectivity on qemu. But I'm unable to start the daemon. I have cloned hello-world file and saved it as a tar using docker commands. I have added the tar file to my…
Shruti
  • 1
  • 1
0
votes
0 answers

How to investigate how the memory in active_file is used for a process

I'm running my process in a Linux container. The memory usage (I believe that is the same value we will get by running 'docker stats') in our dashboard (memory usage dashboard) is about 1GB, but the sum of RSS in 'ps aux' is less than 350MB. Checked…
0
votes
1 answer

Start rust program in cgroupv2

I wrote a BPF sockops program and attach it to a cgroupv2. This applies the BPF program to all sockets from programs in that cgroupv2. How do I go about running a Rust program in this cgroupv2? The Rust program is creating a socket to which I want…
Astor
  • 11
  • 2
0
votes
0 answers

Is it possible to isolate disk storage with container?

With the combination of namespace and cgroup, we can isolate a sets of processes for certain types of resources such as CPU and memory. Then I'm curious is it also possible to isolate disk storage? If so what cgroups/namespace are used? (I'd imagine…
LookIntoEast
  • 8,048
  • 18
  • 64
  • 92
0
votes
1 answer

Does each process have its own cgroup?

I have tried to understand how cgroups work in linux and read this: https://man7.org/linux/man-pages/man7/cgroups.7.html. In the manual, it says the following : A cgroup is a collection of processes that are bound to a set of limits or parameters…
David
  • 624
  • 1
  • 6
  • 21
0
votes
1 answer

Node process gets killed when Memory Cgroup reports OOM, when running on instances with a high RAM and CPU cores, but works with small instances

When running a job as a pipeline in Gitlab Runner's K8s pod, the job gets completed successfully only when running on a small instance like m5*.large which offers 2 vCPUs and 8GB of RAM. We set a limit for the build, helper, and services containers…
0
votes
0 answers

user cgroup.controllers systemd cgroup v2 after restart

enabled cgroup v2 grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=1" add /etc/systemd/system/user@.service.d/delegate.conf with [Service] Delegate=cpu io memory pids after reboot node…
0
votes
0 answers

Why are there so many ". mount" files in the cgroup path "/sys/fs/cgroup/memory/system.slice"?

Why are there so many. mount files in the cgroup path? i checked systemd config but get nothing to do enter image description here
jason gao
  • 1
  • 1
0
votes
0 answers

What is the difference between using cgroup V2 and limiting resources in a docker container?

In a docker compose, it's possible to limit, for example, the memory, like this : deploy: resources: limits: memory: 2G What is the difference with cgroupV2 ?
Lachik
  • 1
  • 1
0
votes
1 answer

How can I enable cpu, memory, and io in cgroupv2 (attempt to run Docker on Android)

I am trying to run Docker on Android, using a Pixel 3a XL rooted, running stock rom but flashed a custom kernel. I need to enable cpu, cpuset, memory, io, and pid controllers in cgroupv2. After enabling them in menuconfig and flashing the kernel,…
Paul P
  • 1
  • 2
0
votes
0 answers

Isolating/Shielding CPUs Allocated To Docker Container with Cgroup V2

I am currently deploying a docker container on Ubuntu 22.04 (Using Cgroup v2) with the following command: docker run --name=testapp --cpuset-cpus=35,39 -it testapp Is there any way at runtime I can ensure no Linux process can use cpus 35 and 39…
PJConnol
  • 119
  • 1
  • 9
0
votes
0 answers

Obtain statistics of CPU and memory usage from one cgroup

Context I have a system in which I have to check periodically usage: relative (percents) for CPU and absolute (GB) for memory. How it's currently implemented Language we're using is python. system-wide psutil For system-wide stats it's trivial…
Jakub Kuszneruk
  • 1,188
  • 1
  • 12
  • 37