Stack Exchange Network

Stack Exchange network consists of 174 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.

-1
votes
0answers
11 views

How guarantee a responsive Desktop using cgroup memory limit

I would like to setup a system with limited memory (raspberry pi) in such a way that application can't cause the desktop (x11, LXDE, openbox, mouse driver, video card driver) to be unresponsive. When ...
1
vote
1answer
19 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 ...
0
votes
1answer
31 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
21 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 ...
1
vote
1answer
72 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. ...
0
votes
0answers
37 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 ...
0
votes
0answers
82 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
31 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
20 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
144 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
32 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
32 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
74 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
66 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
61 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
1answer
465 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
76 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 ...
5
votes
3answers
536 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
208 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
34 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
148 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
43 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
222 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
664 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
234 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
361 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
1answer
346 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
810 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
93 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
102 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
211 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
36 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
200 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
110 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
229 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
82 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
538 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
295 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 ...
0
votes
0answers
126 views

Why isn't my cgroups memory limit applied when using `template` groups?

I'm using Linux kernel version 4.9.27: $ uname -r 4.9.27-14.31.amzn1.x86_64 I have the following in my /etc/cgconfig.conf file: mount { memory = /cgroup/memory; } group users { memory { ...
2
votes
2answers
381 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 ...
0
votes
0answers
113 views

How to iterate tasks in a cgroup, one cpu at a time, holding runqueue's lock?

I want to achieve 3 goals. Iterate tasks through a task_group Aquire rq those tasks attached to. Group those tasks by rq, then lock the rq before iterating tasks (the reason for this: I want cfs_rq ...
2
votes
1answer
1k 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.
1
vote
1answer
148 views

How often are cgroup memory usage values refreshed?

I am wondering how often cgroup memory usage values are refreshed? Is there any parameter to tune it? I saw something similar for CPU, but not memory. For example in this file: /sys/fs/cgroup/memory/...
1
vote
0answers
37 views

Difference between se->cfs_rq->tg and task_of(se)->sched_task_group

Are they different by definition? What are their advantages?
2
votes
2answers
516 views

What is the value for the cgroup's limit_in_bytes if the memory is not restricted/unlimited?

Printing the value of an unlimited docker container I get the value 9223372036854771712 which is 0x7FFFFFFFFFFFF000 (this is the same value of the XUbuntu Host machine). I couldn't find a reference ...
0
votes
1answer
367 views

OCI runtime create failed: systemd cgroup flag passed, but systemd support for managing cgroups is not available

On installing docker when I run the sudo docker run hello-world, I get the following error: docker: Error response from daemon: OCI runtime create failed: systemd cgroup flag passed, but systemd ...
2
votes
0answers
246 views

what is the effect of setting cpu.cpu_quota_us in cpu cgroup?

I am trying to understand if setting cpu.cpu_quota_us in cpu cgroup subsytem has any impact on application performance. Essentially by reducing the CPU quota, but increasing the number of CPUs such ...
1
vote
1answer
207 views

Using cgroup match in PREROUTING chain in iptables

I already use net_cls (network classifier) cgroup from /sys/fs/cgroup/net_cls in POSTROUTING chain. When I try to use it from PREROUTING, I get the following errror: [2514253.432875] x_tables: ...
4
votes
0answers
465 views

iptables and cgroups v2 (netfilter's xt_cgroup)

I can't seem to match processes running in cgroup v2 hierarchies with the cgroup module of iptables. I am running Linux 4.13.0 with all required modules: $ grep CGROUP <kernel_config> ...
2
votes
1answer
543 views

cgroups memory limit - write error: Device or resource busy

I'm running CentOS 7 with kernel 3.10.0-693.5.2.el7.x86_64. I use cgroups to apply a memory limit on processes. During rolling restart of the application the memory limit is doubled to accommodate the ...