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
1
vote
1 answer

Centos7 cgroups, limit cpu shares for cronjobs

Is it possible to limit the cpu shares for processes started from cron? Background: We have shared hosting on Centos7 and customers can make cronjobs via directadmin controlpanel. Sometimes these cronjobs eat all cpu. That's why I would like to…
Vincent
  • 291
  • 1
  • 4
  • 10
1
vote
0 answers

cgconfig daemon restart leaves threads in root cgroup

I'd like to ask if my explanation of the behavior I observe is correct. The behavior: After restarting cgconfig daemon, the processes have correct core affinity (as verified by taskset) but the threads end up with affinity for ALL cores (0-35 in our…
Arkadiy
  • 208
  • 1
  • 8
1
vote
0 answers

cgroup throttle on child device does not work

We're running Docker containers with devicemapper on CentOS 7 (3.10.0-514.10.2.el7.x86_64). For some containers we can easily throttle reads through blkio.throttle.read_bps_device by specifying the parent block device, but for some containers it…
mike
  • 221
  • 1
  • 4
  • 12
1
vote
1 answer

Host mountpoint inside docker volume inconsistency

I have a simple setup, where I bind-mount a host's folder in a container. docker run --rm -it -v /mnt:/mnt ubuntu:16.04 bash Then I mount some other file systems to the host's folder. Mount points appear on the container side, but corresponding…
1
vote
1 answer

How do I set the default memory.swappiness for all the systemd cgroups?

In CentOS 7 how do I set the default memory.swappiness for all the systemd cgroups? I can do it per cgroup via the ControlGroupAttribute option, but I would like to override the default of 60 for all the cgroups.
Jeff Kubina
  • 427
  • 1
  • 4
  • 14
1
vote
0 answers

Replacing net_cls with nftables

I am currently using the net_cls cgroup to classify packets from a process and then later mangle them with iptables. From the kernel and systemd guys it seems that net_cls is deprecated and other tools like nftables are supposed to do the same…
1
vote
1 answer

Can't enable cgroups memory controller

I have Debian 8.5 on DigitalOcean with a kernel version 3.16.7-ckt25-2 I'm trying to enable cgroups memory controller for Docker. I add cgroup_enable=memory swapaccount=1 to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub, run update-grub, reboot…
chingis
  • 243
  • 3
  • 14
1
vote
0 answers

Limiting Oracle instances resources with Cgroups?

Is it possible to limit the amount of resources (I/O, CPU and Memory) a Oracle instance can consume using only cgroups? (no containers or virtualization) The reason I wanna do that is because I want to run performance tests repeatedly on two…
Daniel
  • 66
  • 3
1
vote
2 answers

Will Linux/Ubuntu running in an LXC container understand cgroup memory limits?

I'm planning to rent a physical server and run MySQL inside an LXC container on that server. I'd like to control maximum memory usage for the MySQL instance using cgroup limits : lxc.cgroup.memory.limit_in_bytes = 8192M This will effectively…
sbrattla
  • 1,578
  • 4
  • 28
  • 52
1
vote
0 answers

cgred / cgrulesengd - does not move new user pid to task file

cgrulesengd can't move pid to task file while running as deamon, if I restart cgrulesengd all pids are moved correctly to task file, but new pid's not. So, if i log in as hello user, and then run from root cgrulesengd -n -d, user hello and all his…
Abc Xyz
  • 608
  • 1
  • 8
  • 17
1
vote
1 answer

Cgroups with libvirt/kvm on Centos 6.5

I am trying to limit all the memory used by virtual machines to a particular value. On Ubuntu servers, setting limit to "libvirt-qemu " solves the issue. But in the case of CentOS, it creates libvirt/qemu/virtual-machine-name and it looks like it…
Blue Gene
  • 635
  • 1
  • 5
  • 10
1
vote
0 answers

(Unexpected?) blkio controller behavior

I'm using docker 1.4.0 with lxc-1.0.6 and cgroup-lite-1.1.5 on Ubuntu 12.04. I have 3 hard disks (/dev/[sdb-sdd]) that I write to from 3 distinct containers. They have only one XFS partition, mounted in /mnt/vol[1-3] respectively. I launch the…
ivotron
  • 111
  • 3
1
vote
0 answers

How to change docker lxc/cgroup configuration at runtime

I would like to change docker lxc/cgroup settings while a container is running. As an example, if I launch a container like this: docker run --lxc-conf="lxc.cgroup.cpuset.cpus = 0" ... How do I adjust the setting to "lxc.cgroup.cpuset.cpus = 1"…
kanaka
  • 291
  • 1
  • 6
1
vote
0 answers

How to test if packet has been tagged with classid

I'm trying to troubleshoot an issue I'm having related to IFB Mirroring which I'm attempting to deploy based on this question: Tc: ingress policing and ifb mirroring My theory is that since the ingress traffic is being redirected to/via ifb to be…
Rooster
  • 495
  • 2
  • 7
  • 21
1
vote
3 answers

Cgroups vs Tasksets in KVM

I have a CentOS 6 host for several KVM VMs with FreeBSD as guest. I want to bind each VM to use no more than one core at once. What would you suggest to use, Cgroups or Tasksets?
Mascarpone
  • 872
  • 3
  • 9
  • 28