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

129 questions
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
4
votes
0 answers

Applying systemd control group resource limits automatically to specific user applications in a gnome-shell session

Having seen that GNOME now launches apps under systemd scopes I've been looking at a way to get systemd to apply some cgroup resource and memory limits to my browser. I want to apply a MemoryMax and CPUShare to all app-gnome-firefox-*.scope…
Craig Ringer
  • 10,553
  • 9
  • 38
  • 59
4
votes
2 answers

cgroup fork rejected by pids controller

Have a small server program written in C/C++ that uses nginx and Postgres, currently all are hosted on the same ubuntu system. I usually run the server program from the bash command line. Recently on the newer versions of Ubuntu, when the server…
myk
  • 171
  • 1
  • 4
3
votes
0 answers

`systemctl show` outputs incorrect MemoryCurrent value

on one box, systemctl show get an incorrect value for unit memory usage: $ systemctl show crond | grep MemoryCurrent MemoryCurrent=18446744073709551615 18446744073709551615 == UINT64_MAX, this must be incorrect. but another box shows correct memory…
georgexsh
  • 133
  • 5
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
  • 887
  • 4
  • 14
  • 22
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,154
  • 3
  • 10
  • 23
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
  • 397
  • 1
  • 3
  • 12
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
  • 485
  • 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
  • 485
  • 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…
3
votes
1 answer

cGroups cgred daemon doesnt always move child processes, parent process temporarily in wrong group

So I'm in the process of setting up CGroups on a few servers, and I'm using the documentation pretty heavily to do this. I came across this in section 2.8.1 of the Fedora Resource Management Guide (also weirdly in This redhat guide: The entry now…
Rooster
  • 485
  • 2
  • 7
  • 21
3
votes
1 answer

I/O priority per LVM volume (cgroups)

How can I prioritize LVM volumes I/O performance using cgroups? I know I can use ionice to make changes at the process level but I wish to be able to do this per LV and not per process.
ApriOri
  • 325
  • 1
  • 10
1 2
3
8 9