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

Limit CPU Usage per PHP Pool

I'm running a typical LEMP stack where I have multiple PHP-FPM pools, one for each site that's on a Rocky Linux 8 VPS. Occasionally, some rogue process on one of the sites will cause a huge CPU spike and slow everything else down. I've tried…
thekendog
  • 1
  • 1
0
votes
0 answers

Adding process to cgroup returns error "write error: Invalid argument"

On Red Hat 8.7 on x86_64 I would like to restrict process to be allowed to use only 50% of CPU time. I tried to limit a process with cgroups following Red Hat tutorial Setting CPU limits to applications using cgroups-v1 and I have successfully…
folow
  • 101
  • 2
0
votes
1 answer

Docker Compose + Ubuntu:22.04-Unable To Create cgroup...Read-only file system

I'm playing around with Docker Desktop(4.16.3) and Slurm. When I run slurmd, I get an error with the following complaint: common_cgroup_instantiate: unable to create cgroup '/sys/fs/cgroup/freezer/slurm' : Read-only file system unable to build…
Black Dynamite
  • 523
  • 2
  • 5
  • 16
0
votes
0 answers

Linux Scheduling Affinity when nCores == nPids

imagine you create a cgroup that isolates n logical cores from the general Linux scheduler. then one at a time, you create and run m processes that together comprise n threads. so # of process threads == # of logical cores. i'm trying to decide…
Gukki5
  • 101
  • 3
0
votes
0 answers

Systemd cgroups disrupted after unmounting

We have many virtualization hosts with VM disks residing typically on LVM. When VM is migrated across hosts it maybe required to do some work like rebuilding initramfs. We got used to mount VM disk to the host /mnt, mount proc-dev-sys inside mnt and…
kab00m
  • 498
  • 3
  • 10
0
votes
0 answers

How do CPUShares work across parent and children cgroups?

Redhat has a great blog post describing CPUShares, but it assumes processes reside in leaf CGroups, and doesn't discuss how CPU time is calculated for processes that reside in branch CGroups. For example: what is the CPU usage for each of these…
0
votes
1 answer

Assign systemd slice to a specific cset automatically

On Debian under systemd, by default KVM virtual machines under libvirt get assigned to the "machine.slice" slice. If I then add a cpuset for this slice with cset and some custom set of CPUs, and start a VM, the VM is added to the proper cpuset,…
Joshua Boniface
  • 346
  • 3
  • 14
0
votes
1 answer

Can 1 thread running with a 1-cpu quota on an N-core machine use an entire core?

given: A machine with 8 cores a cgroup with 1-CPU quota the cgroup has only 1 process the process is single-threaded How will the CPUs be made available to the process? the process be able to run full-throttle on a single core all of the…
John Bachir
  • 2,364
  • 7
  • 29
  • 37
0
votes
1 answer

How does Docker distribute work amongst host CPUs?

If I have a host with 8 cores and a Docker container given 1.0 CPU, how does Docker implement this? Does it make make all 8 cpus available at the same time for 1/8 of the time? If so, then a single-threaded process running full throttle won’t be…
John Bachir
  • 2,364
  • 7
  • 29
  • 37
0
votes
0 answers

Where can I find up-to-date documentation for the croupv1 memory resource controller?

Anyone know where can I find some up-to-date documentation for the cgroupv1 memory resource controller? The docs.kernel.org page about the cgroupv1 memory resource controller contains the note at the top: This document is hopelessly outdated and it…
user2279952
  • 121
  • 4
0
votes
1 answer

Setting cgroup limits to all users in network

I have a FreeIPA user authentication set up. There are many users in the system already, along with many host systems (configured IPA clients). I want to set up cgroup restrictions on the tasks these users are doing (specifically, for CPU and…
0
votes
1 answer

How to install cgroup tools on Alpine Linux

I need to install the control group tools on Alpine Linux; on some distros there is a cgroup-tools package or equivalent, but not on Alpine Linux. I have looked for the a package containing any cg* file on the contents pane at…
hstr
  • 145
  • 8
0
votes
0 answers

How to set up multiple apache + php-fpm + mariadb service groups on a single server with per-group resource limits?

We have a centos8 web server hosting hundreds of websites, using 3 services: apache, mariadb and php-fpm. Because apache and mariadb do not support per-account resource limitation, all websites have the same access to many system resources (storage,…
Ján Lalinský
  • 282
  • 1
  • 11
0
votes
1 answer

How to constraint already running interactive processes with cgroup2

My home-server is running some aged hardware (Core i5-3450, software RAID1 on SATA disks) and often has problems when I run performance-intensive things like a compile-job besides "normal" services that run in the background (DNS, Web, DHCP, Mail,…
0
votes
1 answer

How does memory and memoryReservation work for Tasks running on EC2 ECS?

EC2 ECS lets you specify memory and memoryReservation for both ECS tasks and the containers running within those tasks. I understand that memory and memoryReservation on the container settings map to the underlying Docker memory settings. However,…
1 2 3
9
10