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

Why are my resource constraints not respected?

I want to limit the cpu resources that are available to the docker containers on my system.I do not want to limit the resource consumption of individual containers but only for all containers combined....
0
votes
0answers
13 views

Assign certain CPUs to a cgroup

I have 4 CPUs. I want to run a process and allow it to use only CPU number 4 among those. So I created a new cgroup for it, but I cannot find the way to enter such a restriction.
1
vote
0answers
37 views

Setting vm.dirty_ratio per cgroup

I was wondering if there is a way to set vm.dirty_ratio per cgroup? I see that the cgroup2 documentation mentions writeback but it seems that it will only use limits imposed by the memory controller ...
0
votes
1answer
56 views

auto nice daemon

I know path to parent executable (launcher). I would like to kill all other launchers without child processes (if any). I don't know PID of child process(es). Only kids should have high priority (...
0
votes
0answers
22 views

Opennebula deleted machines are not removed from /sys/fs/cgroup/

I am monitoring an open nebula host using netdata, after opening the monitoring dashboards I mentioned there are some qemu one instances in it which don't exist. When I checked the command systemd-...
0
votes
1answer
225 views

How to install cgroups on Mac OS

How can I install on my ordinary MacOS (Darwin Kernel Version 19.2.0: Sat Nov 9 03:47:04 PST 2019; root:xnu-6153.61.1~20/RELEASE_X86_64 x86_64 i386) the Control Groups tools (tools to control and ...
2
votes
2answers
104 views

How to find total active namespaces in linux?

Is there any way to find how many active namespaces of each type are present in Linux? Such as: mount ns: 20 net ns: 40 etc.
0
votes
0answers
49 views

systemd-nspawn: Memory Accounting inside the Container

I've used systemd-nspawn, systemd, machinectl and debootstrap under a Debian 9 machine to setup a simple Debian 10 container as: debootstrap --include=ssh,locales,dbus,net-tools,vim,htop,gnupg2,curl,...
0
votes
1answer
29 views

Using cgroup to limit program memory as it's running

Let's say I have created a cgroup and attach a memory limit of 200MB to the cgroup. I then run a memory-intensive process inside the cgroup, and it uses up its limit of 200MB. As the process runs, is ...
0
votes
0answers
49 views

How to fully enable io.latency controller?

I'm trying to setup my Kodi to never skip. Currently I focus on providing absolute priority to Kodi's I/O. System is Fedora 31. Kernel 5.4.0, has CONFIG_BLK_CGROUP_IOLATENCY=y I've started with ...
1
vote
0answers
32 views

Limiting CPU hyperthreads that cgroup tasks are allowed to access?

Just a quick question about using CPUSET to limit the CPUs a cgroup can access when using a multi-core CPU with hyper-threading. The documentation linked above says: cpuset.cpus (mandatory) ...
0
votes
1answer
284 views

Cgroup memory limits and process killing

I have the following situation: (The following functions are ones taken from python) I have a process A which is running and has a cgroup memory limit set on it. I fork a child process from A using ...
1
vote
2answers
179 views

Fedora 31 - grubby --args=“systems.unified_cgroup_hierarchy=0” broke the system

I upgraded to Fedora 31 today. All good. I came across issue with Docker so I found the solution to run grubby --args="systems.unified_cgroup_hierarchy=0" and then grub2-mkconfig Now, systems won'...
0
votes
0answers
50 views

memory swapping and cgroup

I wonder how is swapping mechanism implemented under the memory cgroup v1. Most existing books (understanding the linux kernel, professional linux kernel architecture, understanding the linux virtual ...
3
votes
1answer
106 views

File/foler permissions & plex

I have an Intel NUC running Kubuntu (based on Ubuntu 18.04.3 LTS \n \l) & Plex server, headless. I used various guidance to set this up. The normal user account to the machine is 'exharris', and ...
0
votes
0answers
91 views

Running cgroups inside EC2 c4.xlarge instances failed - operation not allowed

Problem I'm currently trying to restrict the resource of of a specific user on an AWS EC2 instance. After doing some research online, I thought the following was enough to add a user to a cgroup that ...
0
votes
1answer
174 views

system MemoryMax by percentage not working?

I am trying to configure my .service file to limit how much memory a given service can use up before being terminated, by percentage of system memory (10% as an upper limit in this case): [Unit] ...
0
votes
1answer
249 views

cgroups: throttle per user disk I/O bandwidth on Linux

I have a Linux web server (Debian, just in case that made a difference), which is Apache + PHP-FPM. Each Apache VirtualHost uses a dedicated PHP-FPM pool (through a dedicated unix socket), which runs ...
10
votes
1answer
535 views

Why is conmon in a different cgroup when podman is started with systemd?

Given podman is installed on a linux system and a systemd unit named baz.service: # /etc/systemd/system/baz.service [Service] ExecStart=/usr/bin/podman run --rm --tty --name baz alpine sh -c 'while ...
0
votes
0answers
57 views

Why does groupmems command ask for a password even when executed as root

The groupmems command that allows us to edit group membership has a peculiar trait: When executed as root, it again asks for root password when trying to edit any group membership for any system user. ...
1
vote
0answers
44 views

Compiling a program causes my system to run out of memory, any workarounds?

During the compilation my system runs out of memory on a compilation unit. How can I deal with this issue? One way is to enable swap but just doing that would make the machine unuable while the ...
4
votes
1answer
38 views

How to limit processes to all but one cpu in Linux

I want to limit some processes to run on all but one CPU in a machine. I have looked into it and I believe that cgroups could be a viable solution. More specifically using the cpuset property. ...
0
votes
0answers
183 views

AWS Batch: cgroup-parent for systemd cgroup should be a valid slice named as “xxx.slice”

For some reasons, I need to use Linux kernel 3.10.X for my AWS batch host. I follow this post and created my AMI based on Centos7. What I did was simply created an EC2 instance with Centos 7 and the ...
0
votes
1answer
36 views

echo 4G > memory.max: memory.max always 0

I'm trying to set a memory limit with cgroup2 with this command: echo 4G > memory.max This works fine on my laptop, but on my server cat memory.max always returns 0. No matter what I write to it (...
2
votes
1answer
336 views

Limit resources (cpu/mem) only in ssh session

I have a server with 4 GPUs/128 cores where I use a workload manager (slurm) to manage resource allocation between users for computation. The issue is that the scheduler server (for job submission) ...
1
vote
1answer
139 views

How to run lxc inside of a chroot

I'm trying to run lxc inside of a chroot. $ lxc-start -n instrument --logfile=/dev/stdout lxc-start 20190619141851.659 ERROR lxc_cgfs - cgroups/cgfs.c:cgfs_init:2359 - cgroupfs failed to detect ...
3
votes
1answer
379 views

How do I create a systemd scope for an already-existing process from the command line?

I have a machine running the cgroups v2 (unified) hierarchy, so systemd is responsible for managing all cgroups and delegation to the systemd user instance works. I'd like to perform resource control ...
1
vote
1answer
184 views

libvirt will not start VMs with “error: Invalid value '+cpu' for 'cgroup.subtree_control': Invalid argument”

On one workstation I have, libvirt has stopped working; it'll no longer start VMs: $ virsh --connect qemu:///system 'start westerley-pool' error: Failed to start domain westerley-pool error: Invalid ...
0
votes
0answers
19 views

configuring a process to control memory allocations

cgroup has various configuration setting to restrict the memory usage. memory.memsw.limit_in_bytes memory+swap memory.limit_in_bytes memory But, even though I add PID of a process in ...
3
votes
1answer
73 views

Why would a process limited to a portion of one cpu run slower when the Cpu is partially idle?

A task must receive the same resource allocation, and no more, regardless of whether the rest of the system is idle. The aim is to achieve a predictable time to complete the task irrespective of other ...
1
vote
0answers
52 views

cgroup IO control v.s. (the new types of) Linux AIO

In Linux v5.0, do some types of Asynchronous IO bypass the cgroup IO controllers? EDIT: buffered write() and fsync() might be relatively complex to analyse. I found an interesting post about ...
0
votes
0answers
11 views

Getting info about particular cgroup

my process is attached to a cgroup /user.slice/lim.scope. How to know how does that cgroup limits my process?
1
vote
0answers
210 views

Limit container resources both using --memory and --cgroup-parent

I'd like to limit both total memory consumption for a group of containers as well as memory consumption for a particular container. Say, a container is allowed to consume not greater than 1Gb and all ...
1
vote
0answers
110 views

Setting a timeout and limiting memory of a process

I'm trying to run a large process on my machine with a timeout and maximum memory limit. For handling the memory usage, I created a cgroup and use this shell script to start the process: #!/usr/bin/...
0
votes
1answer
90 views

Does enabling one of the `Accounting=` options in a systemd unit, cause it to be enabled for *all* units?

CPUAccounting= Turn on CPU usage accounting for this unit. Takes a boolean argument. Note that turning on CPU accounting for one unit will also implicitly turn it on for ...
0
votes
0answers
22 views

Linux cgroup memory is not beeing freed

I have an k8s cluster and one of the pods is crashing because of OOM. It has the limit of 400MB but crashing when pod reaches 30MB and I have no idea why. There is no other process in its cgroup but ...
1
vote
1answer
106 views

cgroups (V1) does not work — how to diagnose/debug?

I set up cgroups on a shared system to limit the cpu access to a group to 25% but it does not seem to be working. Here are the steps followed: Add this line to /etc/cgrules.conf: @guest_users cpu ...
4
votes
1answer
122 views

How to have memory/cpu limits only for forked children and not for the parent process?

Is there a way to have limits for (let's say) apache2, that limits each forked child worker process to use max X memory, and not the entire process tree (apache2 and all of its forked children) to max ...
1
vote
0answers
129 views

What is the importance of cgconfig.conf?

I am currently trying to get a deeper grasp into cgroups. I am working with Ubuntu 18.04 and installed the necessary libraries. I am following the documentation from this site: https://access.redhat....
-1
votes
1answer
54 views

Does chroot need any special kernel support?

docker is said to be a steroid version of chroot. Does chroot need any special kernel support, e.g. namespace, cgroup? Does docker rely on chroot? I ask this because "Docker is not virtualisation: ...
-1
votes
1answer
115 views

Is a cgroup a list of key value pairs or a set of processes?

I get the idea that a cgroup is a set of processes satisfying some conditions, from http://man7.org/linux/man-pages/man7/cgroups.7.html A cgroup is a collection of processes that are bound to a set ...
-3
votes
1answer
106 views

What is a docker container from Linux's point of view? [closed]

A docker container is a concept understood by docker daemon. What is a docker container from Linux's point of view? You can stop, kill and destroy a container. Is a container itself a process? Is a ...
1
vote
0answers
34 views

How can I enable asynchronous swapping using a kswapd thread in a cgroup resolution?

I would like to enable active swapping (using a background daemon) on my cgroup even before the entire system is suffering memory shortage. I have a 128GB Linux host and a cgroup that is limited to ...
3
votes
1answer
248 views

How are cpu.cfs_ period_us defined in cgroups and kernel.sched_cfs_bandwidth_slice_us related?

I've been trying to understand how the Completely Fair Scheduler in the Linux kernel does CPU bandwidth control. After many readings, I still cannot understand how the CFS allows for each cgroup to ...
2
votes
1answer
210 views

How do I read the systemd MemoryHigh value from the /sys/fs/cgroup filesystem?

I have a systemd service that sets MemoryHigh and MemoryMax. If I look under its cgroup in /sys/fs/cgroup/memory the memory.limit_in_bytes file matches the limit set by MemoryMax, but where do I find ...
1
vote
1answer
210 views

Granting cpusets permissions to non-root user

By default, only root can create CPU sets (and manipulate tasks in existing ones): $ cset shield -c0 cset: **> [Errno 13] Permission denied: '/cpusets//user' cset: insufficient permissions, you ...
7
votes
1answer
3k views

How to limit a systemd service to “play nice” with the CPU?

I have a systemd service (a CI runner) that tends to bog the system down with very CPU intensive jobs. I caught the load average flying over 100 just now and want to put a stop to that nonsense. ...
1
vote
0answers
373 views

User Resource management: cgroups + systemd + ssh

I am trying to limit the memory of a single user that keeps crashing our OpenSuse Server. What I have done is as desribed here, to modify the limit of the user's slice via systemctl set-property ...
2
votes
2answers
3k views

Systemd under Ubuntu 18.04.1 fails with “Failed to create /user.slice/…service/init.scope control group: Permission denied”

On my Ubuntu 18.04.1 system the User Manager of systemd fails to start. I suppose this to be the root cause of other problems that I currently encounter. Any ideas how to get rid of this? systemd ...
1
vote
0answers
153 views

How do you use cgroups from within a network namespace

I just discovered that mount | grep cgroup returns nothing when you are not in the default network namespace. I can't really find any documentation on this except for that "network namespaces isolate ...