Skip to main content
Share Your Experience: Take the 2024 Developer Survey

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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
71 views

How can I limit resources for non root users using CGroups V2 on Ubuntu 22.04?

Currently, I'm limiting the CPU and Memory for different non-root users in my software via Cgroups v1 in Ubuntu 20.04. I want to upgrade my software to Ubuntu 22.04. How can I safely move to that with ...
G. Raven's user avatar
0 votes
1 answer
317 views

Systemd CGroups - where are logs for exceeding resource limits?

By default systemd assigns resource limits through CGroups like TaskMax, here's a example of this: $ systemctl status sshd ● sshd.service - OpenSSH Daemon Loaded: loaded (/usr/lib/systemd/system/...
GrabbenD's user avatar
  • 101
1 vote
0 answers
129 views

Empty Cgroup entries in Nginx service status output on an Ubuntu server

I am running multiple web application on a single server, using Nginx as the web server. After git pulling an update to one of the django based website, I restarted the Nginx server. To check if ...
Paandittya's user avatar
1 vote
0 answers
491 views

cgroups v2: cgexec causes "cgroup change of group failed"

When I try to use cgexec, I get the error message "cgroup change of group failed". This is how I'm setting up: CGROUPS_DIR='/sys/fs/cgroup' createdGroup_dir="$CGROUPS_DIR/createdGroup&...
brunoais's user avatar
  • 111
1 vote
1 answer
197 views

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 ...
Gui13's user avatar
  • 43
0 votes
2 answers
415 views

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 ...
thekendog's user avatar
1 vote
0 answers
681 views

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 ...
folow's user avatar
  • 111
2 votes
1 answer
294 views

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 /...
Robson Jr's user avatar
0 votes
1 answer
826 views

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/...
Black Dynamite's user avatar
0 votes
1 answer
421 views

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 ...
Lawrence Wagerfield's user avatar
2 votes
2 answers
1k views

Isolating CPUs on AWS/GCP: error mounting cpuset

I have two 32 vCPU instances on AWS/GCP. I'm trying to set up cpu shielding so that CPUs 0, 1 are used by the system, and cpus 2-31 are shielded and only used explicitly by userspace threads. System ...
James's user avatar
  • 25
1 vote
0 answers
2k views

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-...
Jakub Kuszneruk's user avatar
0 votes
1 answer
736 views

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, ...
Joshua Boniface's user avatar
3 votes
1 answer
1k views

How to use cgroup v2 to limit memory and cpu per user group?

With cgroup v1, I can have group configuration in cgconfig.conf and assign groups to different users in cgrules.conf However, it seems to me that cgconfig and cgrules can't be used along with cgroup ...
Lei Yu's user avatar
  • 131
3 votes
0 answers
91 views

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 ...
TO_GA's user avatar
  • 31
2 votes
1 answer
3k views

Limit php-fpm memory usage on a constrained server

I "move" this question from superuser as I think it's more appropiate here. I've actually found sort-of duplicate questions, but none has solved my problem. General scope I have a Nextcloud (...
raneq's user avatar
  • 21
1 vote
1 answer
503 views

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 ...
ananthan's user avatar
  • 1,520
1 vote
1 answer
226 views

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, ...
user2279952's user avatar
0 votes
1 answer
673 views

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 ...
John Bachir's user avatar
  • 2,374
0 votes
1 answer
969 views

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-...
John Bachir's user avatar
  • 2,374
0 votes
0 answers
27 views

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 ...
user2279952's user avatar
0 votes
1 answer
251 views

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 ...
Avneesh Mishra's user avatar
0 votes
1 answer
2k views

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* ...
hstr's user avatar
  • 145
0 votes
0 answers
141 views

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 ...
Ján Lalinský's user avatar
0 votes
1 answer
653 views

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" ...
cyberschlumpf's user avatar
1 vote
1 answer
4k views

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 ...
Daniel Compton's user avatar
0 votes
1 answer
900 views

CGroup not mounted on Fedora 34

I have freshly provisioned Linode instance with Fedora 34. The only thing I have installed on it is libcgroup. cgconfig service is starting properly and there are no errors but the subsystem is not ...
Albert Lilly's user avatar
1 vote
0 answers
172 views

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 ...
Felix Barnsteiner's user avatar
7 votes
0 answers
2k views

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 ...
Craig Ringer's user avatar
  • 11.3k
25 votes
6 answers
44k views

Systemd fails to run in a docker container when using cgroupv2 (--cgroupns=private)

I will attach the minimized test case below. However, it is a simple Dockerfile that has these lines: VOLUME ["/sys/fs/cgroup"] CMD ["/lib/systemd/systemd"] It is Debian:buster-...
Stephen's user avatar
  • 365
0 votes
1 answer
520 views

Monitoring swap usage of cgroup

I have a bunch of .NET Core applications running as systemd units. The host is running out of memory and slowly increasing swap usage to 100% so I suspect one or more of the services has a memory leak....
DaveO's user avatar
  • 175
5 votes
2 answers
7k views

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 ...
myk's user avatar
  • 191
1 vote
1 answer
3k views

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 ...
j4nd3r53n's user avatar
  • 246
3 votes
1 answer
6k views

systemd: how do I create a new .slice file?

I'm struggling to understand how to set up a new slice on my debian 10 system. I have created a file, system-db.slice by copying system.slice and changing a couple of things: # This file is part of ...
j4nd3r53n's user avatar
  • 246
3 votes
1 answer
2k views

How can I control how systemd assigns a service to a slice?

I have been searching for a while for information about how services are assigned to slices - it seems to be a very elusive subject, or maybe I'm not asking the right questions. I've come across How ...
j4nd3r53n's user avatar
  • 246
2 votes
1 answer
389 views

Unable to set a v1 cgroup limit

I have a pids.max limit set to 400, I want to set it to max It is found in /sys/fs/cgroup/pids/pids.max, sudo cgget -g pids:/ /: pids.current: 278 pids.max: 400 I would think that I could set it ...
Azeirah's user avatar
  • 161
0 votes
1 answer
2k views

Hitting a process limit, but unsure how

I run a server, mostly for using with random Docker containers and as a Gitlab-CI runner. Every once in a while, when the server has been running for a week or so, I run into process resource limits. ...
Azeirah's user avatar
  • 161
1 vote
1 answer
739 views

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 ...
Compizfox's user avatar
  • 404
2 votes
0 answers
1k views

ClamAV for the host running docker containers - inotify/fanotify limits

I'm implementing anti-virus solution for Linux with ClamAV daemon running in On-Access mode, watching the created/opened files for malicious content at the host system AND in docker containers, ...
mva's user avatar
  • 141
1 vote
2 answers
1k views

cgroup rt support in Debian Buster (Kernel 4.19.0)

Is it possible to enable the cgroup rt support in Debian Buster (kernel 4.19.0) without recompiling the kernel? Perhaps with a grub configuration parameter? Thanks. Background: Docker logs this ...
erunima's user avatar
  • 31
0 votes
1 answer
2k views

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 ...
user308485's user avatar
2 votes
1 answer
182 views

cgrulesengd-like support for cgroup v2

I was wondering if there are any best practices for automatically assigning processes to certain v2 cgroups based on a rules file or something similar. Pretty much what cgrulesengd did for v1. I have ...
Maran's user avatar
  • 321
0 votes
2 answers
2k views

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 ...
aspyct's user avatar
  • 360
2 votes
1 answer
87 views

Automating scheduling and dispatch of compute jobs by different users

I'm going to set up a Linux server (probably CentOS) in a computer science department. The server will be used as a compute server, by people doing research on GPU computing, bioinformatics, or AI. ...
Nicola Gigante's user avatar
5 votes
3 answers
4k views

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 ...
Simon's user avatar
  • 223
0 votes
1 answer
4k views

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 <...
blue112's user avatar
  • 143
0 votes
1 answer
847 views

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 ...
rfmoz's user avatar
  • 792
1 vote
1 answer
2k views

How to restrict access to GPU?

I'm configuring a small GPU server under Ubuntu 18.04. It should support both interactive and batch jobs. It is dedicated to run machine learning tasks by a small team. We have also some tasks for ...
wl2776's user avatar
  • 181
0 votes
1 answer
2k views

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

When we use kubectl describe pods <pod_name>, a great deal of information is output, including the node that the server is running on, and miscellaneous information about the pod, including the ...
merlin2011's user avatar
2 votes
0 answers
490 views

User Resource management: cgroups + systemd + ssh

I am trying to limit the memory of a single user that keeps crashing our OpenSuse Server. What I have done is as desribed here, to modify the limit of the user's slice via systemctl set-property ...
Johannes Bleher's user avatar