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
2
votes
1answer
43 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
32 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. ...
0
votes
1answer
47 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 ...
0
votes
0answers
57 views

Mount cgroup v1 instead of v2

Some context: I'm trying to get docker containers running under Linux Deploy under Android TV on an Odroid N2 arm64 SBC (kernel 4.9.113). I've got the kernel setup with the necessary bits for docker, ...
2
votes
0answers
158 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, ...
0
votes
0answers
55 views

CGroup per application routing with iptables not working

Usage scenario: Shadowsocks Client ---> Shadowsocks Server (running on VPS A) ---> Wireguard VPN (running on VPS A) ---> Wireguard VPN (running on VPS B) Basically, I'm trying to setup an encrypted ...
1
vote
2answers
224 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
0answers
95 views

flag provided but not defined: -systemd-cgroup with Podman and Nabla

I am trying the runnc Nabla runtime with Podman but I am getting this error: sudo podman run --rm --net=host -p 8080:8080 --runtime=/usr/local/bin/runnc nablact/node-express-nabla:v0.3 Result: ...
0
votes
0answers
162 views

How to run apache server in a given control groups container?

I have an apache server 2.4.41 running on ubuntu 19.10 for which I want to assign a control group so that I can isolate its network traffic and reroute it throw a different network interface. I am ...
0
votes
0answers
300 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
25 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
164 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 ...
0
votes
0answers
24 views

Are cpu quotas on cgroups hard limits or not?

When setting cgroups are they guaranteed to be enforced? I am seeing that a process that belongs to to a specific cgroup that has quota of 52 shares (hence 5% utilization) when I run top it is ...
1
vote
1answer
21 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. ...
1
vote
1answer
519 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
0answers
797 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
210 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 ...
0
votes
1answer
543 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
291 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 ...
1
vote
0answers
216 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
185 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 ...
4
votes
1answer
1k 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
193 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
277 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 ...
0
votes
2answers
294 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
407 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
1k 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
4k 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 ...
2
votes
2answers
9k 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
1answer
1k 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
442 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 ...
4
votes
2answers
5k 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
1k 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
453 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
253 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
137 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
101 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
163 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
592 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 ...
3
votes
1answer
726 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
387 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 = /...
3
votes
1answer
681 views

Is there a way to set the cgroup that systemd launches a process in?

systemd launches a process in the /system.slice/process-name.service cgroup. I would like to launch the process in a different cgroup. I can do this using cgexec in the ExecStart option, but is there ...
2
votes
1answer
158 views

Why LXC requires restart?

LXC documentation says: Just before you create your first container, you probably should logout and login again, or even reboot your machine to make sure that your user is placed in the right ...
1
vote
1answer
2k views

How do I set the default memory.swappiness for all the systemd cgroups?

In CentOS 7 how do I set the default memory.swappiness for all the systemd cgroups? I can do it per cgroup via the ControlGroupAttribute option, but I would like to override the default of 60 for all ...
4
votes
0answers
838 views

How to view cgroups resource control heritage between parents and childs process

Taking for example this hierarchy from systemd-cgls: └─user.slice ├─user-1000.slice │ ├─user@1000.service │ │ └─init.scope │ │ ├─3262 /lib/systemd/systemd --user │ │ └─3263 (sd-pam) ...
1
vote
0answers
183 views

Replacing net_cls with nftables

I am currently using the net_cls cgroup to classify packets from a process and then later mangle them with iptables. From the kernel and systemd guys it seems that net_cls is deprecated and other ...
3
votes
1answer
2k views

Freeze and unfreeze processes transparently?

I'm looking for a way to transparently freeze (pause) a process and then unfreeze it later. This is possible with SIGSTOP, but SIGSTOP causes the parent to be notified (by returning from waitpid), ...