As of May 31, 2023, we have updated our Code of Conduct.

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
-1 votes
0 answers
20 views

Effective computational resource management for a server shared by multiple users [closed]

What would be the optimal approach to effectively manage and restrict CPU and memory resources on a server utilized by a group of approximately 50 users? The server in question is a single-system-...
Piotr M's user avatar
  • 31
0 votes
0 answers
22 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
0 votes
0 answers
52 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
  • 101
1 vote
1 answer
76 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
0 answers
43 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
0 votes
0 answers
149 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
  • 1
1 vote
0 answers
112 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
0 answers
202 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
0 answers
17 views

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 ...
Gukki5's user avatar
  • 101
0 votes
0 answers
22 views

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 ...
kab00m's user avatar
  • 470
0 votes
0 answers
56 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
461 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
612 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
285 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
2 votes
1 answer
578 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
  • 21
1 vote
0 answers
50 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
  • 11
2 votes
1 answer
1k 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
286 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,510
0 votes
0 answers
207 views

setting per user cgroup resource limits per logind

I would like to limit cpu and memory resources per user login. I.e., a new user slice should get assigned the same total cpu share and max memory (except for root). AFAIS systemd-login with details ...
THX's user avatar
  • 243
0 votes
0 answers
71 views

For the memory resource controller in cgroupv1, how to enable the "under_oom" field?

According to the Linux kernel documentation for the cgroupv1 memory resource controller, you can enable or disable the OOM-Killer for a non-root cgroup by running echo 1 > PATH_TO_CGROUP/memory....
user2279952's user avatar
1 vote
1 answer
73 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
303 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,364
0 votes
1 answer
417 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,364
0 votes
0 answers
22 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
0 answers
41 views

How to verify if cgroup tree is writable?

I'm trying to follow this documentation and I'm struggling to understand how can I make the cgroup tree writable or how I can verify it. In that documentation, I have a link towards how can I allow ...
Marius's user avatar
  • 11
0 votes
1 answer
142 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
896 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
81 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
430 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
0 votes
1 answer
2k 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
479 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
129 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
5 votes
0 answers
1k 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
  • 10.9k
22 votes
5 answers
24k 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
  • 333
0 votes
1 answer
349 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
5k 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
  • 181
1 vote
1 answer
2k 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
  • 186
2 votes
1 answer
4k 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
  • 186
1 vote
0 answers
904 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
  • 186
2 votes
1 answer
307 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
1k 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
536 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
  • 384
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
  • 21
0 votes
1 answer
1k 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
125 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
  • 311
0 votes
2 answers
996 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
58 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. ...
gigabytes's user avatar
  • 123
4 votes
3 answers
3k 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
  • 193
0 votes
1 answer
3k 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