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
6
votes
0 answers

How to view cgroups resource control heritage between parents and childs process

Taking for example this hierarchy from systemd-cgls: └─user.slice ├─user-1000.slice │ ├─user@1000.service │ │ └─init.scope │ │ ├─3262 /lib/systemd/systemd --user │ │ └─3263 (sd-pam) │ └─session-3.scope │ ├─3260 sshd: user1…
rfmoz
  • 772
  • 9
  • 15
5
votes
0 answers

Use of cores with `isolcpus` and `cpuset`

I have a Red Hat Enterprise Linux Server release 6.9 (Santiago) (I don't manage it). In the GRUB config file I have, let's say, isolcpus=2-32 (out of 36 cores). I also have a cgroup with cpuset=2-32 assigned via cgset.conf to all important processes…
Arkadiy
  • 208
  • 1
  • 8
5
votes
3 answers

What is required to activate cgroups in Linux

I have a Debian squeeze kernel (linux-image-2.6.32-5-openvz-amd64) which according to the Doku should support cgroups. When I look into the kernel configuration, it does (or is some other kernel configuration required?) # zgrep -i cgroup…
divB
  • 568
  • 1
  • 7
  • 23
5
votes
1 answer

KVM + cgroups: Dom0 process best practice?

I am transitioning from Xen to KVM, and will be using Fedora 14. I plan to use cgroups to assign priorities to VMs. My question is as follows: If I place VMs in various cgroups, should I also put all other Domain-0 (physical host) processes in a…
BigChief
  • 398
  • 1
  • 2
  • 12
5
votes
2 answers

What are the advantages/disadvantages of using cgroups?

I administer several Linux-based servers and we are looking at migrating several JBoss apps as well as a couple of websites running on Apache from a RHEL 5.5 (64-bit) server with 4 cores to a RHEL 6 (64-bit) server with 24 cores. My supervisor has…
Brian
  • 231
  • 8
  • 18
5
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
  • 11,083
  • 9
  • 40
  • 61
5
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
  • 181
  • 1
  • 6
4
votes
3 answers

How does systemd put sshd processes in slices?

I'm diagnosing an SSH bastion I manage. This machine has about 5500 SSH connections with port forwarding at any given point in time. Recently, I ran into an issue where SSH connections where refused because the user slice that holds all these sshd…
Simon
  • 193
  • 2
  • 10
4
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
  • 143
  • 5
4
votes
0 answers

cgexec not inheriting LD_LIBRARY_PATH

My /etc/cgconfig.conf file consists of mount { cpuset = /cgroup/cpuset; cpu = /cgroup/cpu; cpuacct = /cgroup/cpuacct; memory = /cgroup/memory; devices = /cgroup/devices; freezer =…
drjrm3
  • 141
  • 5
4
votes
2 answers

Centos 6 to Centos 7 cgroups

I'm trying to set up resource limits per user in Centos 7, but I can't find the right commands for the new implementation of cgroups (I did read the documentation but it talks about restricting services not users). This are the steps in Centos…
Jesús Carrera
  • 143
  • 2
  • 7
4
votes
1 answer

Cannot start cgconfig on Centos 6.5 : cannot mount cpuset to /cgroup/cpuset: Invalid argument

I'd like to try docker-io on Centos 6.5 but the cgconfig daemon will not start: /etc/init.d/cgconfig restart Stopping cgconfig service: [ OK ] Starting cgconfig service: Error: cannot mount cpuset to /cgroup/cpuset:…
codecowboy
  • 1,307
  • 7
  • 18
  • 31
4
votes
2 answers

Setting the MemoryLimit of a user-created systemd scope using cgroups as user

Related: LImiting overall memory usage for child processes Is there a way for an unprivileged user, or for root to allow an unprivileged user, to create a systemd scope (or other control group managed by systemd) so that the memory usage of the…
Sami Liedes
  • 185
  • 1
  • 5
4
votes
1 answer

Linux cgroups cpuset w/ subs causes cgconfig not to start

I am having a problem trying to separate 2 groups using cpuset subsystem. This works fine, however if i go to add a subgroup to that group (in this case -- user1), cgconfig will fail to start with "Failed to remove a non-empty group". Removing group…
Josh Trier
  • 41
  • 2
4
votes
1 answer

cgroups memory 16GB ceiling

I am trying to use cgroups to limit memory usage of user processes on servers with a large amount of ram (128 GB or more). What we want to achieve is to reserve about 6GB of ram for OS and root processes and leave the rest to users. We want to…
1
2
3
9 10