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
1 answer

Compatibility of bpf_get_ns_current_pid_tgid helper function across different eBPF program types

I'm currently working on a use case where I'm running an eBPF program inside a Docker container. I want to filter requests based on the process ID (PID), but I've encountered an issue with the pids obtained from my hooks(refer). Specifically, I've…
Gourav Kumar
  • 205
  • 1
  • 7
0
votes
1 answer

Attach eBPF sockops program to a specific container cgroup

I want to attach an eBPF sockops program to a specific kubernetes pod. I am using the bpf_prog_attach() helper as follows: err = bpf_prog_attach(sockops_prog_fd, cgroup_fd, BPF_CGROUP_SOCK_OPS, 0); And here is the BPF program that I attach to the…
diviquery
  • 569
  • 5
  • 19
0
votes
1 answer

The cgroups v2 "cpu" controller not available on modern Linux

I really need to learn how to turn on cgroups v2 cpu controller for modern Linux most of which now support by default only cgroups v2 (not cgroups v1). A quote from https://man7.org/linux/man-pages/man7/cgroups.7.html: The cgroups v2 "cpu"…
JenyaKh
  • 2,040
  • 17
  • 25
0
votes
0 answers

--device-cgroup-rule in docker/podman doesn't work

I tried to use in run command the option --device-cgroup-rule in docker/podman, without success. The syntax is -v /dev:/dev --device-cgroup-rule='c 189:* rmw', but all devices still available. Thanks
Jewgeni T.
  • 31
  • 5
0
votes
0 answers

Meaning of "heavy reclaim pressure"

In the Kubernetes documentation, it says "the cgroup’s processes are throttled and put under heavy reclaim pressure". But what does "put under heavy reclaim pressure" mean from the perspective of Kubernetes and CGroup V2?
Florian Vuillemot
  • 500
  • 1
  • 4
  • 10
0
votes
0 answers

Is it legitimate to have multiple MAJ:MIN device numbers in the same line of io.stat?

On one of the nodes in a kubernetes cluster I observe more than one $MAJ:$MIN device number in the same line of the io.stat file. I check io.stat inside the pod on this node and there are two MAJ:MIN numbers in the line #4: # cat…
Vitaly
  • 36
  • 4
0
votes
0 answers

What does "process changes its effective UID or GID" mean in the cgrulesengd man page?

I am planning to user cgrules.config to move processes stared by a user to my cgroup. The man page(https://linux.die.net/man/8/cgrulesengd) of cgrulesengd says that any time a process changes its effective UID or GID it is invoked and moves the…
Ankit
  • 1
  • 1
0
votes
0 answers

Limit combined system resources for a group of containers using cgroup-parent

I have a few services running on a VM. One of these services is user facing and can take up arbitrary amount of system resources bringing down the VM. This service spawns a docker container for each user. Since the resources are shared among many…
Naman
  • 179
  • 2
  • 13
0
votes
0 answers

PHP-FPM & cgroups ( via systemctl/systemd)

I've been trying to limit the CPU usage of PHP-FPM processes for a specific user on my RHEL 8 server using cgroups, but I'm facing an issue where the cgroups are not working as expected. Previously, I used cgred to achieve this, but it has been…
include
  • 1
  • 3
0
votes
0 answers

perf record per docker container based on cgroup

i am running a stress-ng inside a docker container (alexeiled/stress-ng) and would like to run perf record which can be converted in to Flamegraphs docker run -it --rm --privileged alexeiled/stress-ng --cpu 1 --cpu-load 100 --verify -t 5m…
0
votes
0 answers

How to assign Cgroup created in host to a process running in Docker container

I'm am trying to assign Cgroup created in host to a process in Docker container by mounting /sys/fs/cgroup/cpuset/examplegroup/, but getting following error when running container as root. Error response from daemon: failed to create shim task: OCI…
0
votes
1 answer

Redhat CGroup RAM usage file equivalents in Node.js

I have a program that reads the following files: cat /sys/fs/cgroup/cpu/cpuacct.usage /sys/fs/cgroup/cpu/cpu.cfs_quota_us /sys/fs/cgroup/cpu/cpu.cfs_period_us /sys/fs/cgroup/memory/memory.usage_in_bytes…
LuisAFK
  • 846
  • 4
  • 22
0
votes
1 answer

Does Child Cgroup automatically get deleted if there are no processes running under it

I created a child cgroup under parent cgroup and running processes periodically under child. However after sometime, I see that the child cgroup automatically gets deleted. What could be the reason ? Any config while creating child cgroup that tells…
user3082802
  • 47
  • 1
  • 1
  • 6
0
votes
0 answers

CPU time of same workload changes when using cgroups

I am performing the exact same computation on the exact same dataset in two ways: Just executing the code as per usual via the command line. Limiting memory usage using cgroups v2 in Linux. And I'm getting unexpected results when using the time…
Yasmine11
  • 54
  • 3
0
votes
0 answers

how to use cgroup v2 memory controller

i want to use cgroup v2 to control memory firstly: ` cd /sys/fs/cgroup mkdir test cat cgroup.controllers cpuset cpu io memory pids echo 1M > memory.high then open a new terminal and stress -m 1 --vm-bytes 200M --vm-keep #here i get…
jack
  • 1