profile
viewpoint

Ask questionsdocker stats reports wrong memory limit

Container has memory limit set to 64mb, but docker stats reports full system memory. Happens for all my containers, metrics on memory usage are not very helpful now.

web165 ~ # docker inspect -f '{{ .Config.Memory  }}' collectd-mesos-tasks-web165
6.7108864e+07
web165 ~ # docker stats collectd-mesos-tasks-web165 | head -n2
CONTAINER                     CPU %               MEM USAGE/LIMIT     MEM %               NET I/O
collectd-mesos-tasks-web165   0.00%               4.93 MiB/7.79 GiB   0.06%               12.77 MiB/2.472 MiB
Client version: 1.6.0
Client API version: 1.18
Go version (client): go1.3.3
Git commit (client): 4749651
OS/Arch (client): linux/amd64
dServer version: 1.6.0
Server API version: 1.18
Go version (server): go1.3.3
Git commit (server): 4749651
OS/Arch (server): linux/amd64
web165 ~ # docker info
Containers: 13
Images: 136
Storage Driver: devicemapper
 Pool Name: docker-9:127-9961543-pool
 Pool Blocksize: 65.54 kB
 Backing Filesystem: extfs
 Data file:
 Metadata file:
 Data Space Used: 6.908 GB
 Data Space Total: 107.4 GB
 Data Space Available: 100.5 GB
 Metadata Space Used: 9.72 MB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 2.138 GB
 Udev Sync Supported: false
 Library Version: 1.02.88 (2014-08-05)
Execution Driver: native-0.2
Kernel Version: 3.14.18-gentoo
Operating System: Gentoo/Linux
CPUs: 8
Total Memory: 7.79 GiB
Name: web165
ID: WM3Z:52VB:7BAB:6TVK:JS4B:AFOV:FTXV:KEVF:VLHD:WLTZ:A5UV:NBSE

cc @crosbymichael

moby/moby

Answer questions KouLouYiMaSi

image I use k8s start a pod limit memory 80G, but I use docker stats I see 74.51G. my docker version is 18.06.1-ce.

Related questions

start container failed with "failed to umount /var/lib/docker/containers/.../shm: no such file or directory" hot 47
upgrade docker-18.09.2-ce , shim.sock: bind: address already in use: unknown hot 24
start container failed with "failed to umount /var/lib/docker/containers/.../shm: no such file or directory" hot 17
runc regression - EPERM running containers from selinux hot 11
Windows Server 2019 publish ports in swarm not working hot 11
"docker stack deploy">"rpc error: code = 3 desc = name must be valid as a DNS name component" hot 9
OCI runtime exec failed: exec failed: cannot exec a container that has stopped: unknown hot 8
Swarm restarts all containers hot 8
integration: "error reading the kernel parameter" errors during CI hot 8
hcsshim::PrepareLayer failed in Win32: The parameter is incorrect hot 8
Docker 18.09.1 doesn't work with iptables v1.8.2 hot 7
Error response from daemon: rpc error: code = DeadlineExceeded desc = context deadline exceeded hot 6
Containers on overlay network cannot reach other containers hot 6
write unix /var/run/docker.sock->@: write: broken pipe hot 6
feature request: docker cat command hot 6
Github User Rank List