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

129 questions
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
  • 485
  • 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

Limit resources of a group of users on Debian 10

I know how to set limits per user: systemctl set-property user-1000.slice CPUQuota=5% However, I don't know how to set the limit for a group of users. I want to limit the sum of the CPU usage of all the users in a specific group. I also tried…
TO_GA
  • 1
0
votes
0 answers

setting per user cgroup resource limits per logind

I would like to limit cpu and memory resources per user login. I.e., a new user slice should get assigned the same total cpu share and max memory (except for root). AFAIS systemd-login with details logind.conf handle per user configurations. Can I…
THX
  • 213
  • 1
  • 9
0
votes
0 answers

For the memory resource controller in cgroupv1, how to enable the "under_oom" field?

According to the Linux kernel documentation for the cgroupv1 memory resource controller, you can enable or disable the OOM-Killer for a non-root cgroup by running echo 1 > PATH_TO_CGROUP/memory.oom_control How do I get the under_oom field of that…
user2279952
  • 121
  • 4
0
votes
1 answer

Can 1 thread running with a 1-cpu quota on an N-core machine use an entire core?

given: A machine with 8 cores a cgroup with 1-CPU quota the cgroup has only 1 process the process is single-threaded How will the CPUs be made available to the process? the process be able to run full-throttle on a single core all of the…
John Bachir
  • 2,344
  • 7
  • 29
  • 37
0
votes
1 answer

How does Docker distribute work amongst host CPUs?

If I have a host with 8 cores and a Docker container given 1.0 CPU, how does Docker implement this? Does it make make all 8 cpus available at the same time for 1/8 of the time? If so, then a single-threaded process running full throttle won’t be…
John Bachir
  • 2,344
  • 7
  • 29
  • 37
0
votes
0 answers

Where can I find up-to-date documentation for the croupv1 memory resource controller?

Anyone know where can I find some up-to-date documentation for the cgroupv1 memory resource controller? The docs.kernel.org page about the cgroupv1 memory resource controller contains the note at the top: This document is hopelessly outdated and it…
user2279952
  • 121
  • 4
0
votes
0 answers

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 delegation of other controllers in cgroup, which I…
Marius
  • 11
  • 1
0
votes
0 answers

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 doing it: $ /usr/bin/ps -opid,cgroup $PPID $$ …
rrauenza
  • 533
  • 3
  • 15
0
votes
1 answer

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 users are doing (specifically, for CPU and…
0
votes
0 answers

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* file on the contents pane at…
hstr
  • 143
  • 7
1 2 3
8
9