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

learn more… | top users | synonyms

2
votes
0answers
9 views

What is “state-object” in cgroups

I am gathering some idea about lxc, kernel name spaces and cgroups. While reading man lxc-cgroup, i find : lxc-cgroup gets or sets the value of a state-object (e.g., 'cpuset.cpus') in the ...
4
votes
1answer
65 views

Permanent swapping with lots of free memory

We have a Linux server running Debian 4.0.5 (Kernel 4.0.0-2) with 32G RAM installed and 16G Swap configured. The system uses lxc containers for compartmentalisation, but that shouldn't matter here. ...
4
votes
0answers
24 views

How do cgroups interact with non-cgrouped processes?

I have 3 processes on a single core machine. Each process is exactly the same and burns CPU as fast as it can (tight loop). Two of them (A and B) are launched with cgexec in separate groups with ...
1
vote
0answers
12 views

How to set a process’s sched method to fifo and priority when cgroup are on?

I’m using CentOS 6.6, I want to set the sched method of my kvm VM to FIFO with priority 1. First, I use chrt and get error: chrt(): "failed to set pid XXX's policy" I find here: chrt(): ...
1
vote
1answer
13 views

Configure scheduling to a program

The program "checking" should be autostart when the machine boot and should be start always with scheduling round robin with priority 27 in Rhel/Centos 7. I can configure this scheduling with cgroups ...
2
votes
0answers
46 views

Sandboxing a binary on linux

I am trying to understand various options I have to restrict/sandbox a binary in Linux. I see that I can use namespaces and cgroups like docker does. I could use SELinux like this link suggests. Which ...
0
votes
0answers
42 views

How to mount cgroups controllers using cgconfig.conf, while systemd running

I am trying to create a basic cgroups setup on a few Fedora 20 servers (using cgconfig and cgred services). The problem is I would like to create a hierarchy with access to several ...
0
votes
1answer
29 views

How do I read from memory.pressure_level in a cgroup?

I want to see the memory pressure of the cgroup. But simple cat memory.presure_level fails. How do I know the current memory pressure of a cgroup?
0
votes
0answers
46 views

how to set cpuset/cgroup.clone_children flag to 1

I am trying to set the cpuset/cgroup.clone_children to 1 so that whenever I create a cgroup, it should by default copy all values from the parent cgroup. Also I am curious if there is a way to copy ...
2
votes
1answer
52 views

Linux cgroups: limit CPU usage in absolute values which do not depend on CPU speed

I have a server with a 2.4GHz processor. And there are several cgroups, each one allowed to use 25% of CPU. That's equal to 600MHz. Then I replace the CPU with a faster one, let's say 3.0GHz. If I ...
1
vote
0answers
29 views

cgroup memory.usage_in_bytes always zero for some tasks

I am trying to use cgroup to manage memory on a HPC cluster using torque queue manager on CentOS 6 machines. Just to test I login to a node running a job where I have: ...
0
votes
1answer
124 views

High on %wa from top command, is there any way to constrain it?

Here's my last top info before it stucks: top - 18:26:10 up 238 days, 5:43, 3 users, load average: 1782.01, 1824.47, 1680.36 Tasks: 1938 total, 1 running, 1937 sleeping, 0 stopped, 0 zombie ...
1
vote
1answer
96 views

How to ensure ssh via cgroups on centos?

When some cpu-intensive processes are running on the server, chances are that we could not log in to this machine with error 'operation timeout' via ssh command. According to this post answered by ...
0
votes
0answers
113 views

Using Cgroups with Systemd to restrict bash cpu & memory

I want to restrict every user on my Centos 7 server who is logged in via SSH. They should not be able to use, for example, a forkbomb and kill the whole system. The superuser will have no restriction. ...
0
votes
0answers
27 views

Why my limit on CPU does not validate via cgroups

/etc/cgconfig.conf ... group memlimit { memory { memory.limit_in_bytes = 8589934592; } } group cpulimit { cpu { cpu.shares = 1024; } } /etc/cgrules.conf: ...
1
vote
0answers
16 views

A way to set parameters in the LXC parent cgroups

So I have LXC installed, guest containers configured and all. The LXC containers each go into their own submodule (in cgroup parlance) and each are configured with cpu.shares and also the memory ...
0
votes
0answers
57 views

LINUX processes are forking up to thousand of processes again, even after kill command

On one of our boxes, I'm encountering strange problem from time to time.. in.tftpd processes are forking up to thousand of processes, getting server to almost unresponsive state. I've tried various ...
1
vote
0answers
71 views

Limit system processes using cgroups

My server runs several dozens of processes that are not in my control (mostly monitoring software). According to my application logs, sometimes some of the third party processes try to allocate too ...
0
votes
1answer
100 views

ubuntu lts and cgroup support in iptables [closed]

I don't understand why Ubuntu community built iptables without cgroup support and what I don't understand if community didn't make it? Maybe Ubuntu use another some way (iptables without cgroup etc)? ...
0
votes
0answers
92 views

Cgroups usage in Ubuntu and Centos using libcgroup C++ API

I am trying to create a C++ application that limits resources for the current process based on some configuration specified by user using the libcgroup API ...
4
votes
0answers
45 views

Does managing cgroups require root access?

I am trying to work with control groups on two different operating systems (Ubuntu and Centos). There are few concerns that I would like to ask. I am trying to create a control group using the ...
1
vote
1answer
18 views

Adding entire session to a cgroup

How would I add entire session to a cgroup. cgclassify seems to add just the specified PID.
1
vote
1answer
70 views

Distributing CPU cores between cgroups and outside world

Is it possible to manage access to CPU cores in a similar fashion that memory limiting works? In particular I need to be able to dynamically create and destroy cgroups that will limit a particular ...
7
votes
1answer
223 views

Simplest possible secure sandboxing (limited resources needed)

I'm working on a project that implements distributed simulations: arbitrary code is executed on multiple nodes and the results are later collected and aggregated. Each node is an instance of an ...
1
vote
0answers
269 views

receive signal before process is being killed by OOM killer / cgroups

In our cluster, we are restricting our processes resources, e.g. memory (memory.limit_in_bytes). I think, in the end, this is also handled via the OOM killer in the Linux kernel (looks like it by ...
4
votes
2answers
2k views

How to create user cgroups with systemd

I use unprivileged lxc containers in Arch Linux. Here are the basic system infos: [chb@conventiont ~]$ uname -a Linux conventiont 3.17.4-Chb #1 SMP PREEMPT Fri Nov 28 12:39:54 UTC 2014 x86_64 ...
4
votes
1answer
173 views

Executing a “fork bomb” safely

We've all seen the "fork bomb" that will render a host non-responsive, even if executed in an unprivileged shell: Warning: Do not execute the following shell script. Just don't. :(){ :|:& };: ...
6
votes
1answer
182 views

Can you throttle the bandwidth to a tmpfs based ramdisk?

I created a ramdisk using tmpfs as follows: sudo mount -t tmpfs -o size=1024m tmpfs /myramdisk I was looking into cgroup blkio subsystem bandwidth limits "read_bps_device" and "write_bps_device" ...
2
votes
2answers
149 views

Need help finding the CPU id numbers to use with cpu sets

The man for cpuset doesn't seem to clearly list how to figure out which numbers map to which processing units. My current machine has two Intel Xeon E5645s, each of which has 6 cores and ...
2
votes
0answers
99 views

How to calculate blkio shares in cgroups?

Currently I'm trying to setup a test scenario with the use of Debian Wheezy with its default kernel 3.2.60-1+deb7u3 and the cgroups blkio controller. The calculation of blkio.weight is not working for ...
1
vote
0answers
146 views

Cgroups unrecognised service

I'm running the following command, after having modified my version of /etc/cgconfig.conf but get the following error (I'm running Ubuntu 14.04). Does anyone have any idea why this is the case? $ ...
0
votes
1answer
201 views

Fedora 20 memory.limit_in_bytes not working

Fedora 29 (kernel 3.15.10-201.fc20.x86_64) This worked in F19. I'm trying to use cgroups to limit memory usage for some apps that are prone to misbehaviour, and I'm encountering problems. I'm ...
1
vote
2answers
586 views

How to enable swap accounting for memory cgroup in Archlinux?

On my Archlinux box I want to limit some applications to a smaller amount of memory using cgroups. Since I use swap, I need to account memory+swap. How can I enable swap accounting?
2
votes
0answers
87 views

Cgroups - memory subsystem

I want to set the memory.limit_in_bytes parameter for a control group and disable OOM, so processes freeze when the limit is reached. But i want to change that limit dynamically, if there is more ...
0
votes
0answers
2k views

Unable to mount cgroup

I've been searching for a solution to this problem but none was working. I would like to start my LXC container but i need to mount cgroup before. [root@stag-devCentOs ~]# lxc-start -n debianLxc ...
2
votes
0answers
98 views

CGroup Processes Not Terminated even when main process has been killed through Systemctl stop command

I am running systemctl stop process command for some process. Please find the output for systemctl status process below: Loaded: loaded Active: deactivating (stop-sigterm) CGroup: ...
3
votes
1answer
2k views

USB passthrough for LXC containers

PROBLEM: So I've been trying to get a usb device (primesense - the OEM reference for the Kinect) to passthrough to an LXC container so I can develop without worrying about polluting my stable system ...
3
votes
2answers
238 views

Monitor when read/write on metadata or mmaped files hit the disk

On a server hosting a wide range of websites, I often see IO becoming a bottleneck without being able to identify the processes responsible of IO operations with tools such as iotop, iostat or sar. I ...
6
votes
1answer
166 views

Do processes in cgroups have to be set every boot? If so, how to persist them?

I was reading this answer to a question on setting limits for processes by using cgroups. The sample given sets limits for a process (in the example, sshd). In the answer, the PID of the process is ...
7
votes
1answer
552 views

Why are cgroups mapped differently on these two systems by systemd

I have two systems, both running customized variants of OpenSuSE 12.2 (Mantis), both running exactly the same kernel. I get two very different outputs of /proc/self/cgroup or /proc/$$/cgroup on the ...
1
vote
1answer
118 views

cgroups analogue in Darwin

Is there an analogue to cgroups in Darwin for preventing processes from escaping from the control / monitoring of its parent process by means of fork()? If yes, what is it? For some background, ...
3
votes
1answer
328 views

What priorities can be used in cgroups net_prio module?

Cgroups has a module called net_prio, and by using this module I can set the priority of network traffic generated by various applications. As you can read here, this can be achieved by setting ...
3
votes
0answers
263 views

What does hierarchy support do in cgroup?

cgroup has 2 options for memory control: memory.use_hierarchy = 1 : use hierarchy memory.use_hierarchy = 0 : use flat hierarchy, according to this answer What is the difference between the two? I ...
9
votes
1answer
1k views

Turning off swapping for only one process with cgroups?

I would like to turn off swapping for only one process. Swap should work as usual for the other processes. How I can implement this with cgroups?
5
votes
3answers
303 views

Externaly limiting number of CPU cores used

I need to externally limit a process/session to a certain number of cores. Are there any other possibilities than CPU affinity (I don't like the need to specify the actual cores) and cgroups (hard to ...
3
votes
2answers
865 views

cgroups: blkio.weight doesn't seem to have the expected effect

I've got 2 LXC containers with these cgroup settings: lxc.cgroup.blkio.weight = 200 lxc.cgroup.cpu.shares = 200 and lxc.cgroup.blkio.weight = 800 lxc.cgroup.cpu.shares = 800 I have verified in ...
3
votes
2answers
128 views

Reference documentation for cgroups (control groups) settings

I'm looking for some reference documentation to explain what each of the settings are, for each control group. For example, there's cpuset.cpus, I think setting this to 0 means use all CPUs, setting ...
1
vote
0answers
589 views

cgroups, cpuset changing the cpuset of some processes fail

I am trying to "reserve" a core on a CPU for performance measurement. I have mounted a cpuset cgroups vfs. I created two subgroups like this: /cpuset.cpu_exclusive 1 /cpuset.cpus 0-3 ...
9
votes
2answers
912 views

How to solve this memory issue gracefully?

I have a standard Linux (Debian testing) laptop, with a swap partition. I do a lot of experiments with it. Some of them are really memory hungry and the way Linux behaves by default is an issue for ...
3
votes
0answers
582 views

cpu time measurement with wait4 vs. cpuacct cgroup

I want to start a process and measure the cpu time (user+sys) it needs until it terminates. I know I can use the wait4 system call, which returns a struct with user and system time (I use the sum of ...