Questions tagged [cgroups]

cgroups are used to control resource management in kernel. They remain in an hierarchy and a new group can be created just by creating a directory in the appropriate place. Using cgroups, a lot of resource management can be done including memory, cpu etc.

cgroups (abbreviated from control groups) is a Linux kernel feature that limits, accounts for, and isolates the resource usage (CPU, memory, disk I/O, network, etc.) of a collection of processes.

369 questions
253
votes
17 answers

Elasticsearch: Max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

I have an issue with a systemd config for ElasticSearch. [Unit] Description=platform-elasticsearch After=syslog.target network.target remote-fs.target nss-lookup.target [Service] User={{ app_user }} Group={{ app_group…
casibbald
  • 2,805
  • 2
  • 16
  • 14
131
votes
3 answers

difference between cgroups and namespaces

I recently started learning docker and it seems that most of the heavy lifting is done by the Linux kernel, using namespaces and cgroups. A few things which I am finding confusing are: What is the difference between a namespace and a cgroup? What…
InsatiableTraveller
  • 1,545
  • 2
  • 10
  • 9
52
votes
3 answers

Difference between KVM and LXC

What is the difference between KVM and Linux Containers (LXCs)? To me it seems, that LXC is also a way of creating multiple VMs within the same kernel if we use both "namespaces" and "control groups" features of kernel.
JuliandotNut
  • 1,169
  • 1
  • 12
  • 22
46
votes
6 answers

Limit memory on a Docker container doesn't work

I am running the last version of Docker on top of Ubuntu 13.04 (Raring Ringtail): root@docker:~# docker version Client version: 0.6.6 Go version (client): go1.2rc3 Git commit (client): 6d42040 Server version: 0.6.6 Git commit (server): 6d42040 Go…
Disco
  • 4,226
  • 11
  • 58
  • 76
44
votes
2 answers

Memory usage discrepancy: cgroup memory.usage_in_bytes vs. RSS inside docker container

"Kubernetes" (v1.10.2) says that my pod (which contains one container) is using about 5GB memory. Inside the container, RSS is saying more like 681MiB. Can anypony explain how to get from 681MiB to 5GB with the following data (or describe how to…
burnettk
  • 13,557
  • 4
  • 51
  • 52
35
votes
3 answers

Android Process Scheduling

I am trying to get a better understanding so I can scope the reliability impact from potential interoperability issues when creating an android app/service. I would like to figure out how process priority is determined. The differences in priority…
Gregg Rivinius
  • 775
  • 1
  • 8
  • 13
22
votes
1 answer

What happens to other processes when a Docker container's PID1 exits?

Consider the following, which runs sleep 60 in the background and then exits: $ cat run.sh sleep 60& ps echo Goodbye!!! $ docker run --rm -v $(pwd)/run.sh:/run.sh ubuntu:16.04 bash /run.sh PID TTY TIME CMD 1 ? 00:00:00 bash …
Michael Snoyman
  • 31,100
  • 3
  • 48
  • 77
21
votes
2 answers

Multi threading with Millicores in Kubernetes

I am confused of the concept of millicores in Kubernetes. As per my programming knowledge, only one thread can run per core so why would I set a limit in millicores? For example, if I set a CPU limit of 600m to a container, can I use 400m for…
Divyang Shah
  • 3,577
  • 5
  • 14
  • 27
20
votes
5 answers

kubelet fails to get cgroup stats for docker and kubelet services

I'm running kubernetes on bare-metal Debian (3 masters, 2 workers, PoC for now). I followed k8s-the-hard-way, and I'm running into the following problem on my kubelet: Failed to get system container stats for "/system.slice/docker.service":…
Jérôme Pin
  • 1,363
  • 4
  • 18
  • 33
17
votes
1 answer

How to enable cgroup v2 in WSL2?

The easiest way to get access to cgroup v2 capable system having only a Windows machine is to spawn WSL2 instance hosting Ubuntu 22.04. Unfortunately, there is an issue. Removal of v1 controllers doesn't result in that controllers added in v2…
Ivan_a_bit_Ukrainivan
  • 808
  • 1
  • 10
  • 27
16
votes
1 answer

Why cgroup’s memory subsystem use oom-killer instead of return memory allocation failure when progress allow memory over cgroup limit?

We use cgroup limit procedure use more resource。 but,when Memory is more than limit in cgroup,it will kill process。 Why cgroup’s memory subsystem use oom-killer instead of return memory allocation failure when progress allow memory over cgroup…
sean
  • 163
  • 1
  • 5
15
votes
5 answers

How to get docker container ID from within the container with cgroup v2

As Docker supports cgroup v2 since engine version 20.10, it will automatically use it on distributions that have cgroups v2 enabled. The known solutions to get the unique container ID from within the container, do not work anymore. / # cat…
jan-di
  • 755
  • 7
  • 16
15
votes
2 answers

Memory Limit and CPU Limit in Docker Container

UPDATE: found a lot of questions and discussions on stackoverflow about this topic. And although they are marked as accepted answered and started by thousands of users, they do not seem to be the right answer here. I ran a docker (version 1.13.1,…
pythonician_plus_plus
  • 1,244
  • 3
  • 15
  • 38
12
votes
3 answers

Why Does Podman Report "Not enough IDs available in namespace" with different UIDs?

Facts: Rootless podman works perfectly for uid 1480 Rootless podman fails for uid 2088 CentOS 7 Kernel 3.10.0-1062.1.2.el7.x86_64 podman version 1.4.4 Almost the entire environment has been removed between the two The filesystem for /tmp is xfs The…
Rob Paisley
  • 437
  • 1
  • 3
  • 13
12
votes
2 answers

Allocate or Limit resource for pods in Kubernetes?

The resource limit of Pod has been set as: resource limit cpu: 500m memory: 5Gi and there's 10G mem left on the node. I've created 5 pods in a short time successfully, and the node maybe still have some mem left, e.g. 8G. The mem usage is…
Yang
  • 759
  • 2
  • 9
  • 30
1
2 3
24 25