Docker looks up in wrong directory for cgroups settings #15095

Closed
ashishbista opened this Issue Jul 28, 2015 · 4 comments

Comments

Projects
None yet
3 participants

I'm trying to limit the memory size for containers. I'm running Docker with exec-driver lxc. It looks like Docker is looking in the wrong directory for cgroups settings.

Docker: sudo docker -d -e lxc

docker version:

Client version: 1.7.1
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 786b29d
OS/Arch (client): linux/amd64
Server version: 1.7.1
Server API version: 1.19
Go version (server): go1.4.2
Git commit (server): 786b29d
OS/Arch (server): linux/amd64

docker info:

Containers: 22
Images: 53
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 98
 Dirperm1 Supported: false
Execution Driver: lxc-1.0.7
Logging Driver: json-file
Kernel Version: 3.13.0-59-generic
Operating System: Ubuntu 14.04.2 LTS
CPUs: 4
Total Memory: 7.447 GiB
Name: poisonta
ID: X2NK:ZIP4:TOIC:BDAR:ZEFE:ROE6:NQ3X:H2SJ:RYPQ:YCLG:KEYU:7X2Z

uname -a:

Linux poisonta 3.13.0-59-generic #98-Ubuntu SMP Fri Jul 24 21:05:26 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Server Type: Physical

Command used to create a container: sudo docker run --lxc-conf="memory.limit_in_bytes = 10000" -i -t ubuntu_trusty /bin/bash

Log:

WARN[0275] Your kernel does not support OOM notifications: open /sys/fs/cgroup/memory/user/1000.user/c2.session/lxc/0ef985ea04fc85871f4f77b19250371523274cef43ce813e986cf24770e4d6e4/memory.oom_control: no such file or directory 
INFO[0275] POST /v1.19/containers/0ef985ea04fc85871f4f77b19250371523274cef43ce813e986cf24770e4d6e4/resize?h=50&w=186 
ERRO[0275] Handler for POST /containers/{name:.*}/resize returned error: Cannot resize container 0ef985ea04fc85871f4f77b19250371523274cef43ce813e986cf24770e4d6e4, container is not running 
ERRO[0275] HTTP Error                                    err=Cannot resize container 0ef985ea04fc85871f4f77b19250371523274cef43ce813e986cf24770e4d6e4, container is not running statusCode=500

Steps to reproduce the issue:

  1. Run Docker daemon: sudo docker -d -e lxc
  2. Create container: sudo docker run --lxc-conf="memory.limit_in_bytes = 10000" -i -t ubuntu_trusty /bin/bash
Member

thaJeztah commented Jul 28, 2015

ping @ashahab-altiscale is this your area, or should I ping someone else? :-)

@ashishbista can you try sudo docker run --lxc-conf="lxc.cgroup.memory.limit_in_bytes=1000" -i -t ubuntu_trusty /bin/bash

lxc.cgroup.memory.limit_in_bytes = 2560M

@justanshulsharma The command worked and created a container but, I doubt it actually limited the memory for the container.

$ sudo docker run --lxc-conf="lxc.cgroup.memory.limit_in_bytes = 2560M" -i -t ubuntu_trusty /bin/bash
root@e323f2a834e3:/# free -m
             total       used       free     shared    buffers     cached
Mem:          7626       5542       2083        444        861       1880
-/+ buffers/cache:       2800       4825
Swap:         8446          0       8446

Never mind, I read the doc and understand why it is showing up the details of host machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment