Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
1answer
18 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
29 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
38 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
44 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
0answers
51 views

systemd-logind: Failed to create cgroup … No such file or directory

Getting the error below in auth.log. Had a similar issue with sshd and systemd before however but I think this is unrelated. cgroup is involved somehow. Any thoughts? This host is running as a Proxmox ...
0
votes
1answer
79 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
94 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
54 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 ...
2
votes
1answer
558 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
75 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
106 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
106 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
266 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
526 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....
1
vote
1answer
2k 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 ...
1
vote
1answer
3k 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="...
2
votes
0answers
802 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
328 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 ...
2
votes
2answers
2k 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
517 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
929 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
308 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 ...
1
vote
0answers
709 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
198 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
119 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
91 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
110 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 ...
1
vote
1answer
749 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
464 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
369 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
272 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 = /...
2
votes
1answer
507 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
142 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
1k 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 ...
3
votes
0answers
608 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
125 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), ...
3
votes
0answers
172 views

Can cgclassify be used with systemd based resource management?

So as of redhat/centos 7, system resource management got a big overhaul. Before redhat/centos 7, cgroups were run using libcgroup packages and daemons like cgred. Before, if I wanted to move a ...
3
votes
0answers
286 views

How to trigger initial login so user slice gets created

I may be taking the wrong approach here, but the new centos 7 implementation of cgroups lets you put limits on user's access to system resources by attaching said limits to their slices. Ie. ...
1
vote
1answer
1k views

Can't enable cgroups memory controller

I have Debian 8.5 on DigitalOcean with a kernel version 3.16.7-ckt25-2 I'm trying to enable cgroups memory controller for Docker. I add cgroup_enable=memory swapaccount=1 to ...
0
votes
1answer
71 views

cgroup same process with different resources

I have a Jboss application server installed through source and running multiple instances(say 3) of JBoss as a same user in a single machine on different ports. Using cgroups, I'm trying to do ...
10
votes
1answer
3k views

How does CPU affinity interact with cgroups in Linux?

I'm trying to run multi-threaded benchmarks on a set of isolated CPUs. To cut a long story short, I initially tried with isolcpus and taskset, but hit problems. Now I'm playing with cgroups/csets. I ...
0
votes
1answer
111 views

iptables is marking packets with wrong number while copying file by scp

[Case1] When copying file from server (being on client) to client, packets are marked incorrect with 3 (root). [Case2] When copying file from server (being on server) to client, packets are marked ...
1
vote
0answers
41 views

Limiting Oracle instances resources with Cgroups?

Is it possible to limit the amount of resources (I/O, CPU and Memory) a Oracle instance can consume using only cgroups? (no containers or virtualization) The reason I wanna do that is because I want ...
1
vote
2answers
772 views

Will Linux/Ubuntu running in an LXC container understand cgroup memory limits?

I'm planning to rent a physical server and run MySQL inside an LXC container on that server. I'd like to control maximum memory usage for the MySQL instance using cgroup limits : lxc.cgroup.memory....
3
votes
1answer
3k views

CGroups memory limit not working

I am trying to limit memory usage for a LXC container using CGroups, but I can't limit the memory. # lxc-cgroup -n maxdaniel981 memory.limit_in_bytes 134217728 lxc_container: failed to assign '...
3
votes
2answers
4k views

Centos 6 to Centos 7 cgroups

I'm trying to set up resource limits per user in Centos 7, but I can't find the right commands for the new implementation of cgroups (I did read the documentation but it talks about restricting ...
6
votes
1answer
967 views

htop cgroup column widen

How can I see full length of text CGROUP column in htop? I cannot enlarge it.
1
vote
0answers
580 views

cgred / cgrulesengd - does not move new user pid to task file

cgrulesengd can't move pid to task file while running as deamon, if I restart cgrulesengd all pids are moved correctly to task file, but new pid's not. So, if i log in as hello user, and then run ...
2
votes
1answer
5k views

Cgroups, limit memory per user

Is it possible to limit memory usage per user not per group? This is my config ... /etc/cgconfig.conf mount { cpu = /cgroup/cpu_and_mem; cpuacct = /cgroup/cpu_and_mem; memory = /...