Questions tagged [cgroup]

cgroups (control groups) is a Linux kernel feature to limit, account and isolate resource usage (CPU, memory, disk I/O, etc.) of process groups.

cgroups (control groups) is a Linux kernel feature to limit, account and isolate resource usage (CPU, memory, disk I/O, etc.) of process groups. This work was started by engineers at Google (primarily Paul Menage and Rohit Seth) in 2006 under the name "process containers"; in late 2007 it was renamed to Control Groups (due to the confusion caused by multiple meanings of the term "container" in the Linux kernel) and merged to kernel version 2.6.24. Since then, many new features and controllers have been added.

One of the design goals of cgroups was to provide a unified interface to many different use cases, from controlling single processes (like nice) to whole operating system-level virtualization (like OpenVZ, Linux-VServer, LXC). Cgroups provides:

  • Resource limiting: groups can be set to not exceed a set memory limit — this also includes file system cache.
  • Prioritization: some groups may get a larger share of CPU or disk I/O throughput.
  • Accounting: to measure how much resources certain systems use for e.g. billing purposes.
  • Isolation: separate namespaces for groups, so they don't see each other's processes, network connections or files.
  • Control: freezing groups or checkpointing and restarting.

Source Wikipedia

138 questions
4
votes
2 answers

route traffic from a cgroup via a specific network interface

Is there a possiblity, to restrict a cgroup to a specific network interface? All packets from the cgroup should only be routed via a VPN connection, while other packets use the default route. With unix users its possible with iptables "-m owner…
allo
  • 1,620
  • 2
  • 22
  • 39
4
votes
1 answer

Cannot find network subsystem in cgroup on Ubuntu 12.04 LTS

I'm trying to use cgroups to limit a process's network bandwidth, as described in this answer. However, I am unable to find the "files" they refer to. I am using Ubuntu 12.04 LTS with cgroup-bin installed. cgroups are automatically mounted under…
user1202136
  • 143
  • 1
  • 5
4
votes
1 answer

How to find which cgroup caused OOM?

I'm using cgroup to partition my processes and I'm getting Out Of Memory messages in my kernel logs. However, I can't find which partition causes them. I've checked the memory controller cgroup but there are no obvious ways to use it. The problem…
Cyberax
  • 269
  • 1
  • 5
4
votes
1 answer

cgroup administration and inheritance

In cgroups there seems to be an option called 'cgroup.clone_children' for each subsystem, that allows you to specify if the setting of the parent cgroup should be inherited into the child cgroups. But I have not been able to find any evidence that…
elventear
  • 223
  • 1
  • 2
  • 6
3
votes
2 answers

Kubernetes cgroup driver misconfiguration

Default Docker installation in CentOS starts with systemd Cgroup. I installed Kubernetes from official YUM repo and systemd drop-in 10-kubeadm.conf has the following…
Gasim
  • 977
  • 4
  • 14
  • 23
3
votes
0 answers

Enable cgroups on Beowulf compute nodes

We are running a Beowulf cluster using the Scyld distribution from Penguin Computing, and it looks like cgroups are configured on the head node, but not the compute nodes. I'm trying to configure Slurm to use the proctrack/cgroup plugin, but it…
Don Kirkby
  • 1,354
  • 3
  • 11
  • 23
3
votes
2 answers

I can't get the cgroup blkio to throttle the iops of processes in a sub-cgroup

I can't get the cgroup blkio to throttle the iops of processes in a sub-cgroup. I am using CentOS 7, 3.10.0-229. I create the cgroup /sys/fs/cgroup/blkio/user.slice/test1 and do echo 8:32 10 >…
Jeff Kubina
  • 427
  • 1
  • 4
  • 14
3
votes
1 answer

Is there a way to set the cgroup that systemd launches a process in?

systemd launches a process in the /system.slice/process-name.service cgroup. I would like to launch the process in a different cgroup. I can do this using cgexec in the ExecStart option, but is there a better way?
Jeff Kubina
  • 427
  • 1
  • 4
  • 14
3
votes
1 answer

Why LXC requires restart?

LXC documentation says: Just before you create your first container, you probably should logout and login again, or even reboot your machine to make sure that your user is placed in the right cgroups. Can somebody explain why this is required to…
Jacek L.
  • 131
  • 2
3
votes
1 answer

Freeze and unfreeze processes transparently?

I'm looking for a way to transparently freeze (pause) a process and then unfreeze it later. This is possible with SIGSTOP, but SIGSTOP causes the parent to be notified (by returning from waitpid), which e.g. causes bash to put interactive processes…
3
votes
0 answers

Can cgclassify be used with systemd based resource management?

So as of redhat/centos 7, system resource management got a big overhaul. Before redhat/centos 7, cgroups were run using libcgroup packages and daemons like cgred. Before, if I wanted to move a process into a cgroup, I could do something…
Rooster
  • 495
  • 2
  • 7
  • 21
3
votes
0 answers

How to trigger initial login so user slice gets created

I may be taking the wrong approach here, but the new centos 7 implementation of cgroups lets you put limits on user's access to system resources by attaching said limits to their slices. Ie. systemctl set-property user-1005.slice…
Rooster
  • 495
  • 2
  • 7
  • 21
3
votes
1 answer

CGroups memory limit not working

I am trying to limit memory usage for a LXC container using CGroups, but I can't limit the memory. # lxc-cgroup -n maxdaniel981 memory.limit_in_bytes 134217728 lxc_container: failed to assign '134217728' value to 'memory.limit_in_bytes' for…
maxdaniel98
  • 103
  • 2
  • 11
3
votes
1 answer

Centos 7 & Hard CPU Limits

OS Version Information: [root@localhost system]# cat /etc/redhat-release CentOS Linux release 7.1.1503 (Core) Configuration for the test.slice is as follows: [root@localhost system]# cat test.slice [Unit] Description=Test…
sydraz
  • 131
  • 2
3
votes
1 answer

Restrict I/O Write usage using cgroups

I am trying to restrict I/O write usage on my server using cgroups. Here is my partition table info: major minor #blocks name 8 0 10485760 sda 8 1 9437184 sda1 8 2 1047552 sda2 Here is my Filesystem…
1 2
3
9 10