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
5
votes
1 answer

Where is my container's memory going?

I have a container leaking memory. Or at least, reported memory consumption goes up fast. If I run top, I get this: top - 16:56:51 up 6 days, 17:25, 0 users, load average: 0.16, 0.27, 0.31 Tasks: 4 total, 1 running, 3 sleeping, 0 stopped, …
ledneb
  • 169
  • 6
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
  • 538
  • 1
  • 6
  • 22
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
4
votes
2 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
  • 1
  • 10
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
  • 139
  • 5
4
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
  • 694
  • 9
  • 15
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,287
  • 5
  • 17
  • 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…
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,524
  • 1
  • 19
  • 35
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
  • 249
  • 1
  • 5
1
2
3
8 9