People who code: we want your input. Take the 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
0answers
13 views

Trying to throttle a device with Cgroups. Error message says “No such device” when the device exists. What could be wrong?

Instructions I followed: https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v1/blkio-controller.html Script I ran: BYTES_PER_SEC=1048576; MAJOR=259 MINOR=1 echo "device name:&...
0
votes
0answers
63 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 ...
0
votes
0answers
17 views

Applying Linux memory/CPU quotas to pools of shell users

I have a set of shell servers being used by researchers where I need to set some quotas to prevent them from using so many resources that admin logins are blocked, but otherwise allow them a lot of ...
9
votes
1answer
1k 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-...
0
votes
1answer
141 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....
1
vote
1answer
1k 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 ...
0
votes
0answers
14 views

Can't enable memory controller in Red Hat 8

I'm not able to enable memory controller in Red Hat 8. There is no cgroup_disable=memory in GRUB_CMDLINE_LINUX_DEFAULT. Any ideas? [root@RH8 ~]# cat /proc/cgroups #subsys_name hierarchy ...
0
votes
0answers
327 views

Syntax for using systemd-run to limit CPU and memory usage of multiple processes?

I would like to use Linux control groups (cgroups) to limit CPU and RAM usage of multiple processes. If the processes are Process 1 and Process 2 with child process Process 2 Sub, would this be the ...
0
votes
1answer
431 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 ...
0
votes
1answer
730 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 ...
0
votes
0answers
39 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 ...
2
votes
1answer
114 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 ...
0
votes
1answer
376 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. ...
1
vote
1answer
197 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 ...
2
votes
0answers
594 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, ...
1
vote
2answers
808 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 ...
0
votes
1answer
442 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 ...
1
vote
0answers
38 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 ...
0
votes
2answers
367 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 ...
1
vote
1answer
27 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. ...
4
votes
2answers
1k 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 ...
0
votes
1answer
2k 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 <...
0
votes
1answer
366 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 ...
1
vote
1answer
939 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 ...
0
votes
1answer
494 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 ...
2
votes
0answers
268 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 ...
1
vote
1answer
370 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 ...
5
votes
1answer
2k 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 ...
0
votes
1answer
257 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: [...
1
vote
0answers
403 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 ...
1
vote
2answers
401 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 ...
0
votes
1answer
472 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 ...
1
vote
1answer
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....
3
votes
1answer
6k 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 ...
3
votes
2answers
13k 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="...
3
votes
2answers
2k 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/...
2
votes
1answer
511 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 ...
6
votes
2answers
8k 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 ...
2
votes
2answers
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. ...
0
votes
1answer
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 ...
1
vote
1answer
558 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 ...
3
votes
0answers
1k 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 ...
3
votes
0answers
266 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 ...
1
vote
0answers
147 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 ...
1
vote
0answers
104 views

cgroup throttle on child device does not work

We're running Docker containers with devicemapper on CentOS 7 (3.10.0-514.10.2.el7.x86_64). For some containers we can easily throttle reads through blkio.throttle.read_bps_device by specifying the ...
2
votes
0answers
184 views

How do I audit cgroup changes

I have a container process that is mysteriously changing cgroups long after it has been started. How do I track down who/what is changing it? I tried watching my audit log when manually doing a ...
2
votes
2answers
1k views

I can't get the cgroup blkio to throttle the iops of processes in a sub-cgroup

I can't get the cgroup blkio to throttle the iops of processes in a sub-cgroup. I am using CentOS 7, 3.10.0-229. I create the cgroup /sys/fs/cgroup/blkio/user.slice/test1 and do echo 8:32 10 > /...
1
vote
1answer
616 views

Host mountpoint inside docker volume inconsistency

I have a simple setup, where I bind-mount a host's folder in a container. docker run --rm -it -v /mnt:/mnt ubuntu:16.04 bash Then I mount some other file systems to the host's folder. Mount points ...
4
votes
1answer
1k views

Where is my container's memory going?

I have a container leaking memory. Or at least, reported memory consumption goes up fast. If I run top, I get this: top - 16:56:51 up 6 days, 17:25, 0 users, load average: 0.16, 0.27, 0.31 Tasks: ...
3
votes
0answers
487 views

cgexec not inheriting LD_LIBRARY_PATH

My /etc/cgconfig.conf file consists of mount { cpuset = /cgroup/cpuset; cpu = /cgroup/cpu; cpuacct = /cgroup/cpuacct; memory = /cgroup/memory; devices = /...