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.

cgroups (control groups) is a Linux kernel feature to limit, account and isolate resource usage (CPU, memory, disk I/O, etc.) of process groups. This work was started by engineers at Google (primarily Paul Menage and Rohit Seth) in 2006 under the name "process containers"; in late 2007 it was renamed to Control Groups (due to the confusion caused by multiple meanings of the term "container" in the Linux kernel) and merged to kernel version 2.6.24. Since then, many new features and controllers have been added.

One of the design goals of cgroups was to provide a unified interface to many different use cases, from controlling single processes (like nice) to whole operating system-level virtualization (like OpenVZ, Linux-VServer, LXC). Cgroups provides:

  • Resource limiting: groups can be set to not exceed a set memory limit — this also includes file system cache.
  • Prioritization: some groups may get a larger share of CPU or disk I/O throughput.
  • Accounting: to measure how much resources certain systems use for e.g. billing purposes.
  • Isolation: separate namespaces for groups, so they don't see each other's processes, network connections or files.
  • Control: freezing groups or checkpointing and restarting.

Source Wikipedia

138 questions
0
votes
1 answer

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: [root@host network-scripts]# cat /proc/filesystems…
Sam Alsalem
  • 51
  • 2
  • 9
0
votes
1 answer

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 swap accounting in docker, with ubuntu 18.04? My…
Mascarpone
  • 872
  • 3
  • 9
  • 28
0
votes
1 answer

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 work pretty well but the user with UID=1000 must be…
zavg
  • 123
  • 8
0
votes
1 answer

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 distinct resource allocation for each instance that i…
0
votes
1 answer

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 correct with 1003 (test1). Server ip 192.168.0.16,…
Abc Xyz
  • 608
  • 1
  • 8
  • 17
0
votes
2 answers

Docker hello world gives 'no space left on device'

The command docker run hello-world gives me this error: System error: write /dev/cgroup/docker//cgroup.procs: no space left on device It's a Debian Wheezy, with a 3.16 kernel from backports. (previously upgraded from squeeze) /dev is mounted…
Herman van Rink
  • 185
  • 1
  • 6
0
votes
1 answer

How to ensure ssh via cgroups on centos?

When some cpu-intensive processes are running on the server, chances are that we could not log in to this machine with error 'operation timeout' via ssh command. According to this post answered by peterph, there should be a way to guarantee sshd…
KAs
  • 103
  • 1
  • 4
0
votes
1 answer

High on %wa from top command, is there any way to constrain it?

Here's my last top info before it stucks: top - 18:26:10 up 238 days, 5:43, 3 users, load average: 1782.01, 1824.47, 1680.36 Tasks: 1938 total, 1 running, 1937 sleeping, 0 stopped, 0 zombie Cpu(s): 2.4%us, 3.0%sy, 0.0%ni, 0.0%id,…
KAs
  • 103
  • 1
  • 4
0
votes
1 answer

Is it generally a bad idea to run MongoDB and ElasticSerach on the same nodes

Simple question: is it stupid to run mongodb and elasticsearch on the same nodes within a cluster of three if you take care of mongodb's memory hunger using cgroups and ignore the aspect of concurring io?
fen
  • 415
  • 4
  • 8
0
votes
3 answers

Can you use CGroups inside an OpenVZ Container?

just a quick question, which i have had trouble finding the answer to: The OpenVZ Authors have been contributing a large amount of code to the linux kernel, in order to get virtualization features directly inside your operating system. One example…
RapidWebs
  • 571
  • 4
  • 13
0
votes
0 answers

Trouble using net_cls control group in tandem with tc for packet filtering

I'm having some trouble limiting network bandwidth using the net_cls control group in conjunction with the linux traffic controller (tc). I think I might just be confused about how I'm writing the filter rules. I figured the easiest way to manage…
Rooster
  • 495
  • 2
  • 7
  • 21
0
votes
1 answer

add a cgroup controller into libvirt

libvirt by default has cgroup controllers of ["cpu", "devices", "memory", "blkio", "cpuacct"] as shown in qemu.conf. I want to add one more controller of net_cls. I tried to modify the config file to make the update. cgroup_controllers = ["cpu",…
Purres
  • 239
  • 1
  • 4
  • 18
0
votes
0 answers

Systemd CGroups - where are logs for exceeding resource limits?

By default systemd assigns resource limits through CGroups like TaskMax, here's a example of this: $ systemctl status sshd ● sshd.service - OpenSSH Daemon Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; preset: disabled) …
0
votes
0 answers

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 everything is running well, I ran the command sudo…
Paandittya
  • 101
  • 2
0
votes
0 answers

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" if ! [ -d "$createdGroup_dir" ]; then mkdir -p…
brunoais
  • 101
  • 1