2022 Developer Survey is open! Take survey.

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
2 votes
1 answer
99 views

What is the replacement of memory.swappiness file in cgroups v2

I'm currently migrating from cgroups v1 to cgroups v2. And I can't find the memory.swappiness file that I used in cgroups v1. There are only the following files concerning swap memory.swap.current ...
user avatar
  • 105
0 votes
0 answers
34 views

Use iptables to filter traffic based on cgroup v2

I have been using cgroups and iptables for a while to make decisions on what applications would be allowed access to the network. For example, to only allow outgoing traffic from my own service: mkdir ...
user avatar
  • 101
0 votes
1 answer
22 views

Is there any other way to add program to cgroups-v2 instead of giving their pids?

I am trying to learn cgroups-v2 and practicing it. cgroups-v2 document stated that entering pid is the only way to add a program to cgroups-v2. Is there any other way to add a program's executables to ...
user avatar
0 votes
0 answers
27 views

Isolating a cpu with cupset (cgroup v2)

The latest raspbian OS based on Debian bullseye doesn't support isolcups anymore and it has cgroup v2. The kernel documentation say that cpuset should be used instead of isolcpus. For some application ...
user avatar
  • 211
1 vote
2 answers
112 views

why rmdir can work well when delete cgroup directory but rm -rf can not?

Here is a cgroup tree. Root node is demo and it has only one child demo/ ├── cgroup.clone_children ├── cgroup.procs ├── cgroup.sane_behavior ├── child │   ├── cgroup.clone_children │   ├── cgroup....
user avatar
0 votes
0 answers
52 views

Linux: CPU affinity changes itself on NUMA system

I'm running a Dual Haswell Xeon system (12 cores each, plus HT) and I want to restrict all my applications to run only on one of the two CPUs, at least for all programs that I don't explicitly assign ...
user avatar
7 votes
1 answer
404 views

How can Bash still write to the terminal when blocking access to tty with cgroups?

Environment: OS: CentOS 8 (generic/centos8 Vagrant box) Virtualization: VMware-Workstation 16.1.0 build-17198959 Steps to reproduce: Create a devices new policy cd /sys/fs/cgroup/devices mkdir ...
user avatar
0 votes
0 answers
28 views

unexpected reset above 90% /tmp usage

There is 1GB /tmp folder on an embedded system with 8GB RAM. No swap is configured. If /tmp grows to its limits, I assume OOM-killer does its job and one random service is killed, together with the ...
user avatar
0 votes
1 answer
156 views

Kubernetes OutOfcpu error when Requests.cpu == Limits.cpu

I'm running Kubernetes Jobs in which I set limits and requests both to the same number of CPUs. In some of these jobs I'm occasionally seeing OutOfcpu errors When I kubectl describe pods PODNAME I see ...
user avatar
  • 1,090
3 votes
2 answers
34 views

Understanding order of operation of cgroup configuration files in /etc/systemd/system/*

I am using a Red Hat 8.1 server. I want to limit users using cgroups. I don't understand the order of operation when reading *.conf. I currently have the files : [root@log01 ~]# cat /etc/systemd/...
user avatar
0 votes
0 answers
48 views

Systemd cgroup Problem - CPUQuota doesn't work for high values, but for low values it does

We have a GitLab Server with a docker-executor runner on the same machine. To keep GitLab responsive we want to limit docker to a certain amount of CPU usage. After some research I found several ...
user avatar
  • 101
0 votes
0 answers
16 views

How can I tell the CPU "request" of a cgroup

Whenever I deal with cgroups, I do it through higher level tools like Docker or Kubernetes, these tools allow me to set cgroups in a more "human" way. I just need to say stuff like "1.5 ...
user avatar
  • 181
2 votes
2 answers
46 views

Is cgroup a type of namespace?

Is cgroup a type of namespace? I am asking this because I have seen blogs talking as if cgroup and namespaces are different. However, in different linux commands , cgroup is considered as a type of ...
user avatar
  • 1,201
2 votes
1 answer
116 views

Cgroup and process memory statistics mismatch

I am trying to set up some monitoring to see when a service is using too much memory. The memory usage can be read from two places: the /proc/<pid>/status for the pid, or the /sys/fs/cgroup/<...
user avatar
  • 562
1 vote
1 answer
57 views

Automatically moving forked processes in a different cgroupv2

I've been using apache2-mpm-itk with cgrulesengd in cgroupv1 to automatically classify the child processes that apache2-mpm-itk spawns when servicing web requests for different vhosts for about 3 ...
user avatar
  • 1,327
0 votes
1 answer
38 views

Linux cgroupsv2 missing PSI files

I am currently trying to read the Memory and IO Pressure from the cgroup filesystem. I can confirm that I am indeed running cgroupsv2 as the output from cat /sys/fs/cgroup/cgroup.controllers gives me ...
user avatar
0 votes
2 answers
132 views

What are CGroup Slices Used For

Just been paying attention to systemctl status' branching structure. I realized I was making up stories to explain why it looked like that but had no clue of what it meant. I can't find much info on ...
user avatar
0 votes
1 answer
207 views

How can cgroup.subtree_control be populated in Docker's private cgroup namespace?

For cgroupv2, by default Docker uses a private namespace for cgroups. This is controlled by the --cgroupns flag for docker run and the default-cgroupns-mode daemon option. I need to create child ...
user avatar
  • 113
3 votes
0 answers
66 views

EBUSY when trying to add process to cgroup v2

I'm playing with cgroups v2 on Fedora 35 (kernel 5.15.5-200.fc35.x86_64). I was able to test cpu, cpuset and pids controllers without any problems. But for memory, hugetlb or io I'm having troubles. ...
user avatar
1 vote
1 answer
166 views

unable to append to cgroup v2 cgroup.subtree_controller

I have a tinker board 2s (like raspberry pi) running debian on kernel 4.4.194. I enabled cgroups v2 by adding systemd.unified_cgroup_hierarchy=1 into the /boot/cmdline.txt file as supposed to. the ...
user avatar
  • 111
1 vote
1 answer
64 views

High system load when container hits its memory limit

My server recently crashed, because the GitLab docker/nomad container reached its defined memory limit (10G). When hitting the limit, the container spent 100% of its cpu time in kernel space. (The ...
user avatar
  • 111
0 votes
0 answers
354 views

How can I find out which device or resource is busy?

I'm looking for advice troubleshooting an issue related to 'cgroups' on Ubuntu 18.04. An application (Mullvad) gives the following error in journalctl: [mullvad_daemon][ERROR] Error: Unable to ...
user avatar
2 votes
1 answer
119 views

cgroup v2: how to set `cpuset.cpus` for a slice in a unit file

From man systemd.resource_control, it seems that there is no options for cpuset controller. Then how to set it in a unit file? My purpose is to have the values set during boot time. I know how to do ...
user avatar
  • 291
0 votes
0 answers
41 views

cgroup v2: how to put a user service in a custom slice outside user.slice

My observation is that if systemd-run --slice my.slice --user sleep 10s is run, then this my.slice is not in the root cgroup. Instead, it appears in [root_cgroup]/user.slice/user@1000.service/my.slice/...
user avatar
  • 291
0 votes
0 answers
41 views

Settings of cgroup are resetting to default

I have strange behavior of cgroup. I set group to limit CPU. All ok, all work. But next morning all my settings are resetting to default. What I do: I ran script and I see proc: cat /proc/[PID]/cgroup ...
user avatar
  • 157
2 votes
0 answers
208 views

Why don't I have cgconfig service although I installed cgroup-tools? [closed]

I am using Debian 11 Bullseye. I have installed cgroups-tools and I created a cgconfig.conf file. When I start the cgconfig servive by using: sudo systemctl start cgconfig.service it gives this ...
user avatar
0 votes
0 answers
44 views

Kill all processes spawned by python script

I want to run a python script, that spawns for example Google Chrome. It should return an error if script fails. I tried to use systemd-run --scope --collect python script.py, but without a success - ...
user avatar
2 votes
1 answer
113 views

systemd ignores drop-in configuration files - what am I doing wrong?

On one of my machines with Debian Buster (which ships systemd 241), I wanted to watch resource usage via systemd-cgtop. When I started this utility, I was seeing memory usage, but neither CPU usage ...
user avatar
  • 2,191
2 votes
0 answers
51 views

How do I report the max RSS of a cgroup?

I would like to monitor the peak RSS a cgroup has used since it was created. By "peak RSS" I mean: the sum of all processes' RSS at the point in time where that sum is the greatest. I ...
user avatar
0 votes
1 answer
81 views

Limiting a single process's memory without children using cgroups

I need to limit memory usage for a process, but ignore all its children. How do I do that? Using cgroups is preferred, but not necessary. Note: I want to ignore all current and future children of the ...
user avatar
2 votes
0 answers
75 views

Make memory.limit_in_bytes ignore file cache

When using cgroups (either standalone or as part of docker or kubernetes) memory.limit_in_bytes counts file cache towards the processes memory usage. This has an unexpected side effect that I'm trying ...
user avatar
  • 121
0 votes
0 answers
34 views

How to set memory limit for multiple NUMA nodes separately in cgroup?

I'm creating a cgroup using cgcreate -g cpuset,memory:/test-cgroup Then I set cpuset.mems=0,1 and memory.memory.limit_in_bytes=1073741824 for test-cgroup I assume the 1GB of memory limit is the ...
user avatar
1 vote
0 answers
33 views

cgroups - controlling memory

I am trying to understand how cgroups and namespaces work. I have been able to get to a point where I can execute example programs in example cgroups and see how the memory resource can be controlled. ...
user avatar
0 votes
0 answers
46 views

Reset memory.oom_kill

I am learning about cgroups and trying out a few examples to see how it works. For the memory controller, I created an example group, ran an application that tries to use more memory than it has been ...
user avatar
3 votes
1 answer
1k views

Debian 11, works fine but strange systemd error happen

I'm on Debian 11, on a Virtual Machine using kvm My user can login via console, ssh and lightdm. But there is an error with systemd sudo systemctl status user@1000.service ● user@1000.service - User ...
user avatar
  • 10.9k
1 vote
0 answers
43 views

How do I make a Linux process believe it is using 100% of CPU while limiting it with a cgroup?

Cgroups allow artificially limiting CPU time available to a process using cpu.cfs_quota_us and cpu.cfs_period_us parameters. This however results in a discrepancy when the program monitors its CPU ...
user avatar
  • 5,126
2 votes
1 answer
237 views

Limiting a program's memory usage using `systemd-run`

I'm on Debian Bullseye (hence cgroups v2, afaik) and I'm trying to use systemd-run to limit the memory usage of a process. I need the process to be killed when it goes out of memory (I'm setting up ...
user avatar
  • 201
0 votes
0 answers
24 views

Mystery memory accumulating instead of swapping after a program consumes all 16GB available to it in its cgroup

I'm trying to evaluate the memory usage of some software X in a memory-restricted setting. All that's really necessary to know about X for the purposes of this problem is that its memory consumption ...
user avatar
  • 101
1 vote
0 answers
288 views

Enabling the memory controller on cgroup v2 on fedora 34

I am trying to install kubernetes on a fedora34 machine. The preflight fails with the following error: [ERROR SystemVerification]: missing required cgroups: memory I have been trying to find out ...
user avatar
0 votes
0 answers
40 views

Getting resident memory for cgroup per NUMA-node

Is it possible to know the resident memory set of a cgroup split by NUMA node? /sys/fs/cgroup/memory/<cgroup>/memory.numa_stat only shows total, file, anon and unevictable pages where file is ...
user avatar
  • 681
1 vote
0 answers
71 views

cgroup memory usage is different from sum of memory usage of sub cgroups

The memory usage I see here: sudo cat /sys/fs/cgroup/memory/memory.usage_in_bytes is different the from the sum of memory usage of the sub cgroups, which I calculated by getting all the sub cgroups ...
user avatar
1 vote
1 answer
139 views

CentOS 8: How to add a user to a cgroups?

How to add a user to a cgroups in CentOS 8?
user avatar
  • 223
0 votes
0 answers
204 views

centos 8: Failed to restart cgred.service: Unit cgred.service not found

After run the following comand: yum install libcgroup yum install libcgroup-tools I still not found /etc/cgrules.conf, and when I run systemctl start cgred command, I get the following error: Failed ...
user avatar
  • 223
1 vote
0 answers
170 views

How can I learn why kswapd has very low page reclaim efficiency?

Problem/context I have a (managed) Postgres 10.16 instance running on Fedora 32 in a systemd-nspawn container. Periodically, I see a big spike in "system" CPU usage in our metrics, ...
user avatar
  • 111
4 votes
0 answers
402 views

How do I send signal to all processes in a cgroup?

kill $(< /sys/fs/cgroup/freezer/<name>/tasks ) works, but looks clumsy, produces a warning if cgroup is empty and may hit command line length limit. pkill -F does not accept cgroup tasks file ...
user avatar
  • 5,126
1 vote
0 answers
120 views

"No space left on device" with cgroups v2 writing empty string to `cpuset.cpus`

I'm using Linux 5.11 in the unified cgroups v2 configuration. Following cgroups-v2.rst, I'm trying to reset cpuset assignment of a non-root cgroup (to make it inherit the parent's cpuset). According ...
user avatar
  • 4,707
1 vote
1 answer
194 views

Make a binary to always run in a cgroup

I want to make sure a binary located at certain path is always run as part of a certain cgroup. Everything I found so far involves running the binary through some special command (e.g. with systemd-...
user avatar
  • 3,898
1 vote
0 answers
450 views

How can I restrict the network access of a systemd service?

I have a custom systemd service which I want to restrict to the local interface. On ctrl.blog systemd application firewalls examples I found that it should be possible to achieve this using only the ...
user avatar
  • 509
2 votes
0 answers
108 views

Why memory in /proc/cgroup is different from the total I calculate from file system?

There are two methods to get the total of memory cgroup, calculate it from file system like find /sys/fs/cgroup/memory -type d | wc -l or cat /proc/cgroups. But I find that the two methods get ...
user avatar
  • 21
1 vote
2 answers
506 views

The service cgconfig won't start because it cannot be found

I am trying to create a cgroup hierarchy by following this tutorial I installed the libcgroup package using dnf install libcgroup and the installation was successful. I tried to check the status of ...
user avatar

1
2 3 4 5 6