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
19 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 ...
user avatar
  • 1
0 votes
0 answers
25 views

How to dynamically change cgroup of systemd service subprocesses (gitlab runner)?

I am running a gitlab runner and I want each job to put itself into its own cgroup. I can set the gitlab bash subprocess to the right cgroup, but its children don't inherit the cgroup. This is how I'm ...
user avatar
  • 533
0 votes
1 answer
33 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 ...
user avatar
0 votes
0 answers
259 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* ...
user avatar
  • 143
0 votes
0 answers
31 views

Use cgroups to limit *per process*

I need to limit the CPU usage of each individual process in a group (not just all processes in the same group). My current config is like this, and I think it limits the total cpu usage of the ...
user avatar
  • 101
0 votes
0 answers
41 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 ...
user avatar
0 votes
1 answer
128 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" ...
user avatar
0 votes
1 answer
232 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 ...
user avatar
0 votes
1 answer
83 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 ...
user avatar
1 vote
0 answers
94 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 ...
user avatar
4 votes
0 answers
700 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 ...
user avatar
  • 10.5k
17 votes
3 answers
11k 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-...
user avatar
  • 283
0 votes
1 answer
269 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....
user avatar
  • 175
4 votes
2 answers
3k 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 ...
user avatar
  • 171
1 vote
1 answer
1k 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 ...
user avatar
  • 144
0 votes
1 answer
3k 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 ...
user avatar
  • 144
0 votes
0 answers
292 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 ...
user avatar
  • 144
2 votes
1 answer
196 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 ...
user avatar
  • 161
0 votes
1 answer
953 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. ...
user avatar
  • 161
1 vote
1 answer
379 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 ...
user avatar
  • 375
2 votes
0 answers
867 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, ...
user avatar
  • 141
1 vote
2 answers
921 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 ...
user avatar
  • 21
0 votes
1 answer
806 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 ...
user avatar
2 votes
1 answer
66 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 ...
user avatar
  • 301
0 votes
2 answers
650 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 ...
user avatar
  • 340
1 vote
1 answer
43 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. ...
user avatar
  • 113
4 votes
2 answers
2k 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 ...
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 <...
user avatar
  • 143
0 votes
1 answer
479 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 ...
user avatar
  • 674
1 vote
1 answer
1k 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 ...
user avatar
  • 181
0 votes
1 answer
898 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 ...
user avatar
2 votes
0 answers
348 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 ...
user avatar
1 vote
1 answer
524 views

What's the recommended way to deal with controled processes if CGroups fails?

I've been using the service unit bellow to start a couple of process that happens to have a high CPU and disk bandwidth usage when running. Since the processes I want to limit don't have a way to ...
user avatar
  • 123
6 votes
1 answer
3k views

List of controllers empty with cgroup v2

I am trying to learn how cgroups v2 work. I did this: mount -t cgroup2 none /mnt/cgroup2 That gave me a list of objects in /mnt/cgroup2 root@ubuntu-s-1vcpu-1gb-lon1-01:~# ls -la /mnt/cgroup2/ total ...
user avatar
  • 239
0 votes
1 answer
333 views

Stack trace of mount command shows File not found error

When I run a program, I am getting a mount error: [root@host ~]# ip vrf exec wan1 /usr/sbin/ssh root@1.2.3.4 Failed to mount cgroup2: No such file or directory I know my kernel supports cgroup2: [...
user avatar
3 votes
0 answers
531 views

`systemctl show` outputs incorrect MemoryCurrent value

on one box, systemctl show get an incorrect value for unit memory usage: $ systemctl show crond | grep MemoryCurrent MemoryCurrent=18446744073709551615 18446744073709551615 == UINT64_MAX, this must ...
user avatar
  • 133
1 vote
2 answers
502 views

systemd deletes sub-cgroups started by other services

I have a service (HTCondor batch system), which is started as service unit within cpu,cpuacct and memory cgroup slices (CentOS 7 @ 3.10.0-*). The service starts sub-processes (~~> batch jobs) for ...
user avatar
  • 203
0 votes
1 answer
574 views

Docker swap support in ubuntu 18.04

It seems like Ubuntu 18.04 broke docker swap support. It's working fine in ubuntu 16.04, but this morning when I setup a new server with ubuntu 18.04 it didn't work. Does anyone know how to enable ...
user avatar
1 vote
1 answer
2k views

Page cache usage listed in cgroup's memory.stat file

A cgroup's memory.stat file lists the page cache usage for that cgroup (in cache and total_cache fields). How is the page cache usage derived? For example, file a.txt is opened by both cgroup A and B....
user avatar
  • 203
5 votes
1 answer
9k views

The memory usage reported in cgroup differs from the free command

Why would the free command be reporting a much different mem usage number vs cgroup? $ free -b total used free shared buff/cache available Mem: 2096914432 ...
user avatar
  • 203
3 votes
2 answers
17k views

Kubernetes cgroup driver misconfiguration

Default Docker installation in CentOS starts with systemd Cgroup. I installed Kubernetes from official YUM repo and systemd drop-in 10-kubeadm.conf has the following contents: [Service] Environment="...
user avatar
  • 857
5 votes
2 answers
3k views

Why do user and system cpu in cpuacct.stat not add up to cpuacct.usage?

Question relates to Linux cgroups cpu accounting. I noticed this at the container level, but it persists up to top level. For instance: # cat /sys/fs/cgroup/cpu/cpuacct.stat /sys/fs/cgroup/cpu/...
user avatar
  • 334
2 votes
1 answer
577 views

Cannot move all processes by a user into cgroup using cgred

I am on a CentOS 7.4 server, and trying to setup CGroups. My cgconfig looks like this: # # Copyright IBM Corporation. 2007 # # Authors: Balbir Singh <balbir@linux.vnet.ibm.com> # This ...
user avatar
8 votes
2 answers
11k views

How do I set cgroup limits for systemd user slices?

I would like to limit usage of a system on a per user basis. Since Systemd has native support for cgroups, I think using user slices is the way to go. The problem is: I can't figure out how to set ...
user avatar
  • 321
2 votes
2 answers
2k views

How to detect if a process was killed by cgroup due to exceeding a limit?

I have a global cgroup defined in /etc/cgconfig.conf that limits the amount of memory. Everytime a user runs a command, I prepend cgexec to add the process and its children to the controlled group. ...
user avatar
  • 978
0 votes
1 answer
2k views

CGroup configuration in CentOS 7

I am using CentOS 7 and I have several users registered in system (UIDs: 1000, 1001, 1002, etc) I want to restrict memory consumption for each user using cgroup and systemd. The following commands ...
user avatar
  • 113
1 vote
1 answer
617 views

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 ...
user avatar
  • 191
5 votes
0 answers
2k views

Use of cores with `isolcpus` and `cpuset`

I have a Red Hat Enterprise Linux Server release 6.9 (Santiago) (I don't manage it). In the GRUB config file I have, let's say, isolcpus=2-32 (out of 36 cores). I also have a cgroup with cpuset=2-32 ...
user avatar
  • 208
3 votes
0 answers
282 views

Enable cgroups on Beowulf compute nodes

We are running a Beowulf cluster using the Scyld distribution from Penguin Computing, and it looks like cgroups are configured on the head node, but not the compute nodes. I'm trying to configure ...
user avatar
  • 1,124
1 vote
0 answers
181 views

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 ...
user avatar
  • 208