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.

270 questions
99
votes
7 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
  • 1,253
  • 1
  • 9
  • 13
91
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 ?…
InsatiableTraveller
  • 1,123
  • 1
  • 8
  • 8
47
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,079
  • 1
  • 10
  • 22
42
votes
5 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
  • 3,846
  • 10
  • 54
  • 76
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
32
votes
3 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
  • 11,726
  • 3
  • 45
  • 47
18
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
  • 30,497
  • 3
  • 43
  • 72
16
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,123
  • 4
  • 18
  • 32
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,093
  • 3
  • 9
  • 33
14
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…
kryptosx
  • 143
  • 1
  • 5
11
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
  • 417
  • 3
  • 13
11
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
  • 689
  • 2
  • 8
  • 27
10
votes
1 answer

Using Cgroups to limit cpu usage

I am trying to use cgroups in order to limit the CPU usage. I am using this guide https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Resource_Management_Guide/sec-cpu_and_memory-use_case.html My /etc/cgconfig.conf file is…
SteveGr2015
  • 450
  • 1
  • 5
  • 12
10
votes
1 answer

LXC without chroot

Is there any way to use LXC for resource management using process groups without creating containers? I am working on a service that runs arbitrary code inside a sandbox, for which I am only interested in hardware resource management. I don't want…
Jeroen
  • 28,942
  • 33
  • 116
  • 190
9
votes
1 answer

Cgroups /sys/fs/cgroup is empty on ubuntu

I am new to cgroup. I want to use cgroup to bind Qemu to some CPUs. I am working on Ubuntu 12.04.3 with my own compiled kernel 3.11.0+. Below is some output of my commands. root@xiao-laptop:~/tamlok# service cgconfig start start: Job failed to…
tamlok
  • 627
  • 1
  • 5
  • 15
1
2 3
17 18