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

CFS hardlimit in cgroups

I recently moved to KVM. Previously I was using xen and its capping feature in credit scheduler. Where we can set a cpu cap for a VM. I was searching for a similar feature to set hard limits on a VM in KVM. I recently found that cgroups has a…
sethu
  • 371
  • 3
  • 16
1
vote
1 answer

Using cgroup & tc in linux seems to NOT apply exactly my rates: 10x discrepancy

I'm using the "standard" way that I found everywhere on the internet (including ServerFault) to try and limit the bandwidth of a process, using cgroups & tc. What I see in practice is that the limits I set through tc will be about 10 times more in…
Gui13
  • 43
  • 1
  • 9
1
vote
0 answers

no connection and cgroup error on standalone kubelet with containerd on ubuntu

I am trying to setup kubelet component as standalone service from kubernetes page, though it seems I am missing something. I've configured the containerd + runc (according to steps) with: $ mkdir -p /etc/containerd/ $ containerd config default | tee…
Robson Jr
  • 11
  • 1
1
vote
0 answers

Obtain statistics of CPU and memory usage from one cgroup

Context I have a system in which I have to check periodically usage: relative (percents) for CPU and absolute (GB) for memory. How it's currently implemented Language we're using is python. system-wide psutil For system-wide stats it's trivial…
Jakub Kuszneruk
  • 201
  • 1
  • 2
  • 8
1
vote
0 answers

Limit resources of a group of users on Debian 10

I know how to set limits per user: systemctl set-property user-1000.slice CPUQuota=5% However, I don't know how to set the limit for a group of users. I want to limit the sum of the CPU usage of all the users in a specific group. I also tried…
TO_GA
  • 11
  • 1
1
vote
1 answer

nginx container uses only one out of 4 cores

created an Nginx container with 4 static CPUs docker run -tid --cpus 4 --cpuset-cpus 6,7,8,9 --net=host --name mynginx nginx docker exec -ti mynginx cat /etc/nginx/nginx.conf|grep worker_processes worker_processes auto; Assigned CPUs taskset…
ananthan
  • 1,510
  • 1
  • 18
  • 28
1
vote
1 answer

Which cgroup version(s) does Linux use by default?

By default does Linux always initially mount both cgroupv1 and cgroupv2? What determines whether a Linux machine initially decides to use just cgroupv1 or just cgroupv2 or both? Thanks in advance, James Pedersen
user2279952
  • 121
  • 4
1
vote
0 answers

Does freezing the cgroup wait for TCP send buffers to be flushed?

What guarantees are there for flushing the TCP send buffers, if any, when the freezer subsystem freezes a cgroup? Consider the following scenario: Server A, which runs in a cgroup, sends data to Server B via TCP. The TCP socket is configured to use…
1
vote
1 answer

Limiting resource use per user with cgroups/systemd

Debian 10: I want to limit memory, CPU etc for all users except root; I have found several articles about this, but so far they all revolve around cgconfig, which doesn't seem to be the way it is done now. I have seen some suggestions to use slices…
j4nd3r53n
  • 226
  • 3
  • 14
1
vote
1 answer

Single-node SLURM server: restrict interactive CPU usage

I have SLURM setup on a single node, which is also a 'login node'. I would like to restrict interactive CPU usage, e.g. outside the scheduling system. I found the following article which suggests to use cgroups for this:…
Compizfox
  • 384
  • 1
  • 6
  • 18
0
votes
1 answer

Why does my cgroup report memory usage even though there are no processes running from the cgroup?

When running systemd-cgtop, I get the following result (showing just the first few lines): Control Group Tasks %CPU Memory Input/s…
user308485
  • 275
  • 2
  • 7
0
votes
2 answers

Kubernetes DaemonSet Pod exceeds memory limit but is not killed

We use kubernetes (specifically: openshift) to run our infrastructure in our team. One of the daemonsets, fluentd, is currently causing a lot of trouble, frequently taking full nodes down with huge CPU, memory and disk I/O requirements (like really,…
aspyct
  • 360
  • 1
  • 6
  • 21
0
votes
1 answer

Kill a running process inside a docker

I've run a find command on a very large folder inside my docker, and now it is stuck for more than an hour. I've tried to kill -9 the process, and kill the docker container with docker kill , but nothing helps it move. I can't run…
blue112
  • 143
  • 1
  • 7
0
votes
1 answer

User sessions under the systemd control group hierarchy, why it's needed?

When a user log in a server with systemd, the PAM logic execute pam_systemd. With that module, the users are registered under the systemd control group. This is an example of two users (root and a normal user) login in a server: #…
rfmoz
  • 772
  • 9
  • 15
0
votes
1 answer

Is it possible to get the cgroup path for a Docker container managed by Kubernetes?

When we use kubectl describe pods , a great deal of information is output, including the node that the server is running on, and miscellaneous information about the pod, including the container IDs and images. If we ssh into the node, we…