Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [cgroups]

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

0
votes
0answers
12 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
14 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 ...
2
votes
1answer
44 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
31 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....
-3
votes
0answers
50 views

Does each directory under `/sys/fs/cgroup/` represent a cgroup hierarchy, or a controller?

Does each directory under /sys/fs/cgroup/ represent a cgroup hierarchy, or a controller? (I assume it represents a cgroup hierarchy in the following, because multiple controllers can be mounted to ...
-1
votes
1answer
35 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
44 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
70 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 ...
0
votes
0answers
15 views

How to create a memory limit group for systemd services with internal shutdown of this services according to demand?

I want to do something like that: I have 3 services (A, B and C). I want to join them in something like a .slice file, and set a memory limit for it. But when one of this services need more memory it ...
1
vote
0answers
24 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 ...
2
votes
0answers
24 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 ...
1
vote
1answer
55 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
54 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 ...
0
votes
0answers
26 views

Using Cgroup inside network namespace?

I have a dedicated machine with multiple host interfaces [eth0 for host network] and (eth1, eth2, eth3) additional, 3-static available IPs. I want to create 3 network namespaces for each of these ...
2
votes
1answer
340 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
100 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 ...
1
vote
1answer
310 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
49 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 ...
0
votes
0answers
22 views

limit cpu and memory consumption of all X applications

I want to reserve a small amount of cpu and memory to be able in case of emergency create tty session and kill a memory hogging X application. cgroups provide this functionality. How do I put all my X ...
1
vote
1answer
393 views

Booting with `cgroup: cgroup2: unknown option “nsdelegate”` prevents any graphics from appearing

I recently updated my Linux 4.9.0-8 debian 6.3.0. However, when I restarted my machine, ended up having the message in the title. Preventing me from accessing the graphical terminal. I can't access my ...
1
vote
1answer
44 views

What are the benefits of using longer/shorter periods in cpu.cfs_period_us?

When you want to limit CPU time per process, you can do it via cgroups. There are two parameters that can do the job: cpu.cfs_period_us and cpu.cfs_quota_us. There's some info on the parameters here: ...
0
votes
0answers
69 views

Cannot start lxc container as non-root user

When I try to start a container it fails: # lxc-start -n mycont4 --logpriority debug --logfile /tmp/basta.log -F lxc-start: cgroups/cgfs.c: lxc_cgroupfs_create: 909 Could not set clone_children to 1 ...
0
votes
1answer
98 views

Why can't a fork bomb be killed in zsh in the same way as it's killed in bash?

I wanted to make my system a little bit more resilient to fork bombs. This can be partially achieved by using systemd's DefaultTasksMax parameter, or by using cgroup's pids controler for all valid ...
4
votes
1answer
92 views

How to find out if systemd uses legacy, hybrid or unified mode (cgroupsv1 vs cgroupsv2)?

Systemd can use one of three modes in regard to how it manages cgroups: legacy hybrid unified How can I check which one is it using?
0
votes
1answer
99 views

How to Keep Network Namespace after reboot

I have created a network namespace, but after I have reboot, it've been removed. I don't found an answer at this problem on the internet, so this is why I'm asking you : Is there a way to keep a ...
1
vote
2answers
927 views

How do I check cgroup v2 is installed on my machine?

I want to try cgroup v2 but am not sure if it is installed on my linux machine >> uname -r 4.14.66-041466-generic Since cgroup v2 is available in 4.12.0-rc5, I assume it should be available in ...
0
votes
1answer
139 views

cgroups: Is it possible to limit cpu usage by process name instead of by pid

As we know, cgroups can limit cpu usage of processes. Here is an example: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 30142 root 20 0 104m 2520 1024 R 99.7 ...
6
votes
3answers
733 views

What's “broken” about cpuset cgroup inheritance semantics in the Linux kernel?

To quote the 2013 systemd announcement of the new control group interface (with emphasis added): Note that the number of cgroup attributes currently exposed as unit properties is limited. This will ...
2
votes
1answer
290 views

systemd memory limit user instance not working

I'm using Arch Linux and systemd version is 239. I booted system with systemd.unified_cgroup_hierarchy=1 kernel parameter. I made two unit files, limit.slice and malloc.service. limit.slice is [...
0
votes
0answers
39 views

How can a linux ramdisk not take up cgroup memory limit

I have: 1) a memory cgroup limit setting for user and kernel (.limit_in_bytes, memsw.limit_in_bytes) 2) a tmpfs ramdisk Im running an application under that cgroup memory limit and that application ...
1
vote
0answers
194 views

RVM not detected in multi-user installation

I have two ubuntu users deploy and developers I install rvm using Multi-User: curl -L https://get.rvm.io | sudo bash -s stable by default this one will create rvm group. The rvm will be installed ...
2
votes
1answer
54 views

Are containers transparent to POSIX parent-child process relationships?

Imagine a hypothetical shell that launches all commands in ad-hoc containers with some isolation and resource controls depending on function of each command: cat foo.txt | sed ... | xargs some-...
1
vote
1answer
267 views

CPU usage limit to systemd-nspawn container is not working

I am using systemd-nspawn(systemd version 237) in Yocto's embedded Linux environment. This is the content of /etc/systemd/system/systemd-nspawn\@.service.d/override.conf file ExecStart=/usr/bin/...
3
votes
0answers
918 views

How to use cgroup limit in systemd user slices? [closed]

I have a CentOS 7.4 system which has a number of users who access the system via SSH. I need a way to prevent them from consuming all CPU and memory of the system. For example, each user getting 1 ...
4
votes
1answer
347 views

What's the Linux kernel's behaviour when processes in a cgroup hit their memory limit?

The memory resource controller for cgroups v1 allows for setting limits on memory usage on a particular cgroup using the memory.limit_in_bytes file. What is the Linux kernel's behavior when this limit ...
4
votes
3answers
504 views

Limit memory for browser on Fedora

I would like to limit memory usage for Chromium (/bin/chromium-browser) and Firefox (/bin/firefox) for all users. Before moving to Fedora I was using cgroups for that. However, I heard that on Fedora ...
0
votes
2answers
568 views

Cgroup memory.usage_in_bytes shows incorrect value

I created a Cgroup on my Linux device and noticed that the value of memory.usage_in_bytes (4325376) is bigger than the sum of RSS, CACHE and SWAP (4194304). I read in a reliable documentation, the ...
0
votes
1answer
1k views

Calculating CPU usage of a cgroup over a period of time

If I have a cgroup like user.slice and have CPUAccounting=true set up, I'm wondering how one would calculate the CPU Usage of that particular cgroup over a period of time (such as 1s), using either ...
0
votes
1answer
128 views

Why is machine.slice shown as using memory, when it does not contain any processes?

$ systemctl status machine.slice ● machine.slice - Virtual Machine and Container Slice Loaded: loaded (/usr/lib/systemd/system/machine.slice; static; vendor preset: disabled) Active: active ...
0
votes
0answers
134 views

Switching off real-time group scheduling in the kernel

Is there a way to switch off the real-time group scheduling in the kernel on Centos 7? I have a real-time service that is managed by systemd. But the cpu.rt_runtime_us value is set to 0 by default. I ...
0
votes
1answer
309 views

Limiting RAM for a group of users on Ubuntu Machine

I have a gpu based system. Multiple users use the system, as a result, the RAM frequently gets fully utilized leaving no memory for myself. I want to put a maximum RAM limit on all the users except ...
1
vote
0answers
52 views

CGroup perm for every user in gid

i need every user in group users can work with the following cgroup 'shol'. Here is my cgconfig.conf, if i use the code i can't run with my users in group users gexec. group shol { perm { ...
0
votes
0answers
227 views

CGroup Debian 9 (4.9.82) won't work

i want to use cgroup to manage memory of specific processes. I install cgroup-tools, enabled the memory controller in /etc/default/grub with GRUB_CMDLINE_LINUX_DEFAULT="quiet cgroup_enable=memory ...
0
votes
0answers
131 views

Modify existing overlay mount

Is it possible to insert additional lower layers to an existing overlayfs mount? The idea is to add new features to a running "chroot" so that they immediately see these changes in their root fs ...
2
votes
1answer
294 views

Is my cgroup overloaded?

Suppose I limited the cores a set of processes is permitted to use with cgroup/cpuset option. I need to know if I have too many threads allocated to that cgroup, if the threads are experiencing ...
1
vote
1answer
95 views

cgroup files for uninstalled software

I recently had some issues with running pycharm-community where it completely failed to load, so I decided to completely remove the software and try again with a fresh install. Unlike most software I ...
2
votes
2answers
708 views

Limit total memory usage for multiple instances of systemd service

I'm running some .NET Core processes as systemd services under Ubuntu 16.04 (soon to be 18.04). I have a systemd configuration file (/lib/systemd/system/myservice@.service) that looks like this: [...
5
votes
1answer
385 views

Debian CGROUP Install doesn't work after reboot

After I do this on my Debian Stretch: sudo apt install cgroup-bin cgroup-tools cgroupfs-mount libcgroup1 I can issue this: sudo systemctl set-property user-1000.slice CPUQuota=40% I have 4 vCPU ...
2
votes
2answers
495 views

Where are systemd's configurations for cgroups?

My understanding is that, by default, systemd will start all processes under a single cgroup where cpu.share=1024. If you choose to override the cpu.share for a service, it will create a new cgroup ...
3
votes
1answer
2k views

How can I check if cgroups are available on my Linux host?

Is there a command to check if the container services are running on a Linux system? Someone suggested unshare but I am not sure if that is the best way to do it.