Skip to main content

Questions tagged [cgroups]

Linux cgroups (control groups) allow limiting and accounting for resources on a system, including CPU, memory, and block I/O.

Filter by
Sorted by
Tagged with
0 votes
0 answers
12 views

Memory limits set in your systemd slice are not being enforced correctly

I try to run process with memory and CPU limit but looks like it is not working and I keep running the process bigger than the memory limits. This is what I have: My /etc/systemd/system/group750m....
user63898's user avatar
  • 343
0 votes
1 answer
45 views

Systemd[1]: Freezing execution kali linux

When launching my pc and choose to start up my kali linux from the grub list It reach to the loading screen when the desktop environment appears it spontaneously freez and after seconds I get this ...
user avatar
0 votes
1 answer
35 views

where to enable /sys/fs/cgroup/memory/0/memory.usage_in_bytes?

I try to count total memory usage in linux via /sys/fs For this I've found /sys/fs/cgroup/memory/0/memory.usage_in_bytes in https://docs.kernel.org/admin-guide/cgroup-v1/memory.html#user-interface i'...
Irina's user avatar
  • 101
0 votes
0 answers
58 views

Linux cgroup (v2): Why has setting memory.max no effect here?

I am trying to demonstrate the effect of limiting the memory consumption of a process in a Linux cgroup (v2) by setting memory.max, but executing the following commands as root seems to have no effect:...
Holger Peine's user avatar
1 vote
1 answer
24 views

How to dump a control group info?

Currently I am playing with cgroup-tools and I have found a lot of important tools to manipulate the control groups of the system. (I also know about many similar functionality in systemd, I ...
peterh's user avatar
  • 9,838
0 votes
0 answers
94 views

systemd: Failed to attach to cgroup...No such file or directory

OS Ubuntu-22.04 Kernel-version 6.2.0-39-generic systemd --version systemd 249 (249.11-0ubuntu3.12) Problem description: From a perl script I am trying to stop and start myservice, this script has no ...
RaGa__M's user avatar
  • 169
0 votes
1 answer
65 views

cgroups v2 : io.latency not exists

When I create a cgroup using sudo mkdir /sys/fs/cgroup/my-cgroup, io.latency is not created. Other io files are created, like io.max, io.stat, io.pressure... The content of cgroup.subtree_control ...
Xeway's user avatar
  • 1
0 votes
1 answer
38 views

Ways to isolate cpus between different processes

I'm running speed tests between different versions of the same application. I want to be able to allocate a fixed set of cpus to each application. For example I want to run the application on exactly ...
spinosarus123's user avatar
1 vote
1 answer
56 views

Understanding memory limits in a systemd service: Are they per-process or combined?

I have a systemd service named vcoagent.service running on my Linux system, and I'm trying to understand how memory limits specified for the service (Memory: 300.3M (limit: 500.0M)) apply to the ...
Ackerman Shadow's user avatar
0 votes
0 answers
42 views

Flow of marked packets in Linux network stack

Summary: My question is regarding the flow of marked packets in the network stack. Here is what i have done: I have marked packets in the mangle table using the OUTPUT chain. I have also added a tun ...
itsloop's user avatar
1 vote
1 answer
335 views

cgroup virtual file system is read only for root, when root has write privileges?

As the title of my question suggests, I am trying to edit the properties of my cgroup virtual file system - create new directories, edit the resource limits in certain files, etc - but any write ...
user10709800's user avatar
1 vote
0 answers
110 views

How to make cgroup V2 persist accross system reboot in RHEL 7

I am using RHEL 7. The default Cgroup hierarchy for the system is Cgroup V1. I need the system to have both Cgroup V1 and Cgroup V2 hierarchies co-existing, and I am achieving that by manually ...
Nitin Kumar's user avatar
1 vote
1 answer
49 views

cgexec not placing child process in correct cgroup

I have made two cgroups: sudo cgcreate -g cpu,memory:rustserver sudo cgset -r memory.max=150000000 rustserver sudo cgset -r cpu.max=25000 rustserver sudo cgcreate -g cpu,memory:pyexecutor sudo cgset -...
O'Niel's user avatar
  • 159
0 votes
0 answers
118 views

How is the order of processes killed in cgroup v2 when out-of-memory?

I'm using cgroup v2 on Ubuntu 22.04 to limits users in a group. I'm wondering how the processes are killed when out-of-memory (OOM). For an instance: The computer has 100G memory. I have a group of 4 ...
hffqyd's user avatar
  • 1
0 votes
0 answers
42 views

Where hugetlb controller is auto enabled?

One kvm virtual machine (8 vcpus+8G memory) of Ubuntu 22.04 with cgroup2 system, cat /sys/fs/cgroup/cgroup.subtree_control hugetlb controller included; But another kvm vm (4 vcpus+4G memory) of ...
Foochair Wien's user avatar
0 votes
0 answers
575 views

Troubleshooting Slurm cgroups Plugin on Ubuntu 22.04

I'm facing a challenging issue with the Slurm cgroups plugin on a system running Ubuntu 22.04. We're relatively new to Slurm and started using it for better resource management in complex computing ...
Francisco Maria Calisto's user avatar
0 votes
0 answers
235 views

Orangepi zero 2w. Debian 12 installed. How to pass a kernel parameter at startup time?

I try to install Home Assistant on debian 12 installed on orangepi zero 2w micro. Home Assistant insists on cgroups v1. But debian 12 supports cgroups v2. docker docs said that I can switch to ...
user8866796's user avatar
1 vote
1 answer
242 views

CentOS systemd places service subprocesses started with `sudo` in `user.slice` (instead of `system.slice`)

Subprocesses that are created using sudo within a systemd service are placed in the user.slice. This behavior has been observed only on CentOS 8 (x86_64 20230606) and not on Ubuntu 20.04.5 LTS, where ...
flashy's user avatar
  • 13
1 vote
1 answer
156 views

systemd resource control - IOWriteIOPSMax not working?

I'm trying to limit IO for a specific unit, but the IOWriteIOPSMax attribute does not appear to make a difference. I initially tried IOWeight, but that is more challenging to test, the docs on IOPSMax ...
morisja's user avatar
  • 13
0 votes
1 answer
648 views

How can I change cgroup memory limits in Redhat 9 or Amazon Linux 2?

I have a docker container which requires 16GB RAM in order to run, plus some extra from some processes it starts. The memory consumption on the machine seems to peak at 60-70% from total memory (64GB)....
ezorethyk's user avatar
0 votes
0 answers
17 views

cgroups: can specific core of cpu be limited for time quota?

As far as I've read man pages, it is not possible to limit specific core to say 50% while limiting the whole CPU to 25%. Only options are mimiting set of cores and total processor time quotas. ...
Alex Martian's user avatar
  • 1,065
1 vote
0 answers
34 views

cgroup file in a created group seemingly disappears after a day (including suspend)

I've started using cgoups (cgreate -g cpu:gr1 / cgset -r cpu.max / cgexec) regularly recently. More than once I've noticed I create cgroup and run a command as above, then after a day or two (of other ...
Alex Martian's user avatar
  • 1,065
0 votes
0 answers
67 views

API for querying all cgroups applied to a process in Linux

I'm working on some software that needs to know its own maximum accessible memory. On Linux, this will depend on the cgroups. From what I have gathered, a process can read from /proc/self/cgroup to ...
Migwell's user avatar
  • 417
-1 votes
1 answer
235 views

Limiting process memory usage with systemd-run not working as expected

I'm trying to limit the memory usage of Chrome with systemd-run by starting it with: systemd-run --scope \ -p MemoryMax=16G \ -p MemoryHigh=15G \ -p CPUWeight=70 \ -p StartupCPUWeight=100 \ /...
apidae's user avatar
  • 101
0 votes
1 answer
64 views

Is there a way to prevent a descendant thread from getting into cgroup of its ancestor thread automatically?

I write some threads of my app to a Linux cpu cgroup, created by me, explicitly (let us talk e.g. about v1 for now, but if you know a way for v2, that would be also great). However, I see that ...
JenyaKh's user avatar
  • 346
0 votes
1 answer
57 views

cgroups between containers

I am trying to find out a way to move a process back to the original cgroup after I moved it to a new cgroup under my hierarchy. The situation is k8s cluster, I have a pod on a node (container) and I ...
Aviram's user avatar
  • 1
0 votes
1 answer
471 views

how to add PID inside cgroup.procs with non-root privileges in cgroup-v2 in Ubuntu

I created cgroup in /sys/fs/cgroup. I called it testGrp and I need this cgroup to be controlled by non-root user so I changed the ownership of the whole cgroup directory /sys/fs/cgroup$ sudo chown -R ...
Belal Elkady's user avatar
2 votes
1 answer
804 views

Receive a memory pressure event with cgroups v2 when no memory limit is set

With cgroups v1, it is possible to listen for events about memory pressure. According to the docs, one needs to Create a new eventfd Open memory.pressure_level for reading Open cgroup.event_control ...
Caesar's user avatar
  • 131
0 votes
0 answers
116 views

How do you mark both incoming and outgoing packets to a cgroup v1 net classifier?

I'm attempting to isolate and tcpdump all network traffic from a single process, following the instructions here:(How to mark packets by program): $ sudo bash # mkdir /sys/...
PFudd's user avatar
  • 173
1 vote
0 answers
73 views

why is process running on cpu core that is disabled in affinity mask

when I run taskset -p 242306 I got following output 3ffffffffffc000000000000000000000000000000000000000000038000000 sorry for the long string, there are 256 cores on the box. used taskset -c -p ...
Lei Yu's user avatar
  • 111
0 votes
0 answers
639 views

Docker Error - cgroup mountpoint does not exist: unknown

I have a Python/Flask application (Docker) that calls a Docker in Docker (DinD) process but when that call happens, I see: 2023-07-07T02:21:28.733399366Z Traceback (most recent call last): 2023-07-...
Perry Hoekstra's user avatar
0 votes
1 answer
58 views

Is the system limiting my memory?

I am running some code on a shared remote machine. When running several instances in parallel, they relatively quickly die with std::bad_alloc, while a single instance runs much longer (in any case, 1 ...
Bubaya's user avatar
  • 121
2 votes
1 answer
269 views

What is the way to enforce daily write limits on a disk partition in linux?

I would like to enforce certain write limits on my disk partitions. I would like to limit the amount of data application can write on a given disk partition on hourly, daily or weekly basis. Is there ...
Virat Manvar's user avatar
2 votes
1 answer
481 views

systemd-run MemoryMax/MemoryLimit don't seem to work

Configured systemd to account for memory: $ grep Memory /etc/systemd/system.conf DefaultMemoryAccounting=yes Write a little executable that allocate a 100M: $ cat test.c #include <stdlib.h> #...
Luke Skywalker's user avatar
2 votes
1 answer
445 views

daemon reload resets cgroup.subtree_control of cgroups

I created a cgroup named mycgroup using mkdir /sys/fs/cgroup/mycgroup. Before executing echo +cpu > /sys/fs/cgroup/cgroup.subtree_control: [root@host ~]# cat /sys/fs/cgroup/mycgroup/cpu.max cat: /...
jay's user avatar
  • 31
2 votes
0 answers
277 views

Do I need to stop or pause a container before I export a volume?

To avoid an inconsistent volume backup, I pause (or outright stop) a container before I copy the contents of the volume. Is this still necessary when backing up containers via podman volume export, or ...
Tenders McChiken's user avatar
1 vote
0 answers
74 views

Resource limits getting enforced only for processes in user's terminal not for su [user] from root's terminal

Cgroups v2 is enabled in almalinux 9.1 with kernel 5.14.0-70.22.1.el9_0.x86_64 and systemd 250 (250-12.el9_1.3). Content of /etc/systemd/system/user-1002.slice.d/override.conf: [Unit] Description=User ...
jay's user avatar
  • 31
1 vote
0 answers
54 views

Adding a program with variable PIDs to cgroup

Specifically, I am seeking a solution that can add the program to the cgroup in a seamless and consistent manner. What is the recommended approach to dynamically adding a program to cgroup, such as ...
user216385's user avatar
0 votes
1 answer
54 views

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 ...
Ankit's user avatar
  • 1
1 vote
0 answers
176 views

non-root user starts process belonging to cgroup owned by root

I create a non-root user and then run a simple bash (it just sleeps). However, the process started by that user belongs to a cgroup owned by root. This makes me failing to move the process to the ...
Franz Wong's user avatar
5 votes
1 answer
170 views

Systemd bind rules have no effect in user slice

I want to prevent the user test (1000) from binding to any ports other than say 1537 so according to systemd.resource-control I configure SocketBindAllow=1537 and SocketBindDeny=any for the user Slice....
Gamification's user avatar
1 vote
1 answer
237 views

How to create a private swap file for a specific process or cgroup in Linux?

I'm currently attempting to generate a swap file in Linux that is exclusive to a particular process or cgroup. After going through the LWN article which discusses the patches that enable this ...
Elior Gigi's user avatar
3 votes
0 answers
254 views

When using cgroup v2, is there command line tool equivalent to cgexec command?

As we know, there is command-line management suite, among which there is cgexec command, in cgroup v1. We can start a process immediately under control group. When we are using cgroup v2, is there ...
Cu635's user avatar
  • 39
3 votes
1 answer
618 views

How to add "Freezer" control group to Fedora 36, and does it matter for virtualization if I don't?

I'm trying to (re)install KVM on my development system (which has been often-upgraded over the years since Fedora twenty-something, and on which kvm was installed many moons ago and then forgotten ...
nigel222's user avatar
  • 327
1 vote
1 answer
898 views

Limit CPU usage with cgroup v2 as non-root user: permission denied

I'm trying to limit the CPU usage of a process using cgroups v2. The hierarchy is already created and the limits are set, I just need to write the pid into the cgroup.procs file. The path is /sys/fs/...
zlatonick's user avatar
  • 149
1 vote
1 answer
472 views

cgroup v2 io.max limit not applied

I can't seem to be able to apply io.max limit through cgroups v2 on Rocky Linux 9. Setup: # lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS ... ├─nvme0n1p5 259:5 0 444.9G 0 part │ └─...
mike's user avatar
  • 105
1 vote
1 answer
173 views

Does Linux enforce memory cgroup limits when the page is touched?

When a process first touches a page and the page is added to the mem_cgroup, if that page puts the mem_cgroup over its limit does the kernel immediately signal quota violation?
luke's user avatar
  • 11
2 votes
1 answer
601 views

Configure cgroups v2 for fair resources sharing between users

Is there a way to restrict system resources to users? I know that used to exist a way of forcing every newly spawned process of a user into the specified cgroup by using cgred service along with /etc/...
Centuri0n's user avatar
2 votes
0 answers
73 views

Can systemd be used to dynamically set a system-wide write bandwidth limit for a block device?

I would like to dynamically set a system-wide limit on the write bandwidth for certain block devices. The devices are pluggable and managed by our own service. Currently the service sets/removes the ...
starblue's user avatar
  • 636
2 votes
0 answers
238 views

Why does my control group show no memory usage in cgget and systemd-cgtop, despite containing a process using significant memory?

I'm trying to implement a solution to this problem using control groups, which I have never worked with before. As a first step, I thought I would create a control group, add a process to it, and view ...
Zorgoth's user avatar
  • 403

1
2 3 4 5
7