-
Notifications
You must be signed in to change notification settings - Fork 18.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker stats CONTAINER
reports zero memory usage
#18420
Comments
Thanks for an excellent bug report, and doing the research! Good question, I know memory-limit is affected by the availability of these options, but not sure if they (should) affect reading memory use here. ping @crosbymichael perhaps you know if this is expected behavior if these options are missing, or is this a bug? |
I also get this issue, on my local debian box which currently runs docker 1.9.0. No problem on my Amazon Linux AMI instance (docker 1.8.2) which does not show the following
|
Same issue. I looked on the host and noted that the memory stats are not showing in /sys/fs/cgroup/memory.
Docker Info:
|
Yes, it should effect reading memory usage since cgroup memory accounting is not going to work when missing. Not sure what to do here as printing a warning isn't really going to work since the stats take up the screen... maybe instead of 0/0 we do something like |
In my case, there is a separate issue documenting the enabling of the memory controller for viewing memory stats: #251. @cpuguy83 Documenting the zero stats may indicate that the proper cgroup manager is likely disabled, and how to manually verify via checking for the directory would be helpful. Probably here: https://docs.docker.com/engine/reference/commandline/stats/ or https://docs.docker.com/engine/articles/runmetrics/. While the article explains the connection to cgroups, it does not specify that docker will print zero if the statistic is not present. |
Excuse my ignorance, but is the lack of support due to software or hardware? Perhaps the memory usage, and the memory % columns just not be present when they are unsupported considering that without support the values are inaccurate, and, the admin may have deliberately chosen not to support that feature for whatever reason. |
In my situation, If I do |
I have the same issue using Docker 1.10.3 on Debian 3.16.0-4-amd64 x86_64 GNU/Linux. I am also receiving a warning that my kernal does not have correct modules when I try setting memory limit for my containers. |
@marc0der I have exactly the same problem with the same kernel and docker version. In my case I'm running docker over a Xen VM, and I really thought it was that until I saw that all you have the same problem! |
It seems like everybody reporting the problem here has the default Debian Jessie install. Possible fix: http://awhitehatter.me/debian-jessie-wdocker/ |
I tried it on my instance on Digital Ocean and it worked like a charm!
|
I'm on Ubuntu 14.04 with 4.2.0-18-generic kernel and have mem/swap accounting enabled (docker info doesn't complain). Similar to @murphyke case some containers show statistics, some do not (zeroes only). Those that show have barely correct values, such as 1.5 or 2 Mb, some even few Kbs. I know for sure that it can't be true. What can I do to help troubleshoot this issue? |
yes, it works for me too (Debian Jessie) |
@klokan Thanks, this fixes also the deal on my VMWare with debian Jessie. TL;DR: Your kernel is probably not configured not to have GRUB_CMDLINE_LINUX_DEFAULT="quiet cgroup_enable=memory swapaccount=1" Then run This should bring back memory stats. This should be definitively part of |
@vaab are you interested in opening a PR to add that? |
I have the same issue with Docker 1.7.1 on CentOS 6.7. In most of the cases |
I'm seeing something like this too, some of the containers in docker stats have only zero values. I'm able to reproduce this with containers that have been placed in the network of another existing container, so started like this |
Docker 1.11.2 with AWS AMI Debian 8 HVM.
|
Worked now with the comment suggestion: #396 (comment) before:
after adding (cgroup_enable=memory swapaccount=1) in /etc/default/grub :
And restart the OS. I get now:
😄 🎊 🎉 |
We do experience the same issue - some of the containers are reported with zero MEM usage which is not true as I can see networks traffic changing and processes running. docker version:
but I can see memory stats for the 0726506bbb33 container above reported with 0 MEM usage in memory stats file:
Any ideas why this happens ? |
Hi, I have the same issue once in a while:
Env:
|
Hi, GRUB_CMDLINE_LINUX_DEFAULT="init=/bin/systemd console=hvc0 console=ttyS0 cgroup_enable=memory swapaccount=1" Any idea on how to diagnose/fix this issue? |
If anyone is looking for this issue on RaspberryPi OS, you will have to edit |
I am using Ubuntu 20.04(LTS) on Raspberry pi4. In my case, the 'cmdline.txt' file was present in '/boot/firmware/' folder. I followed the solution mentioned above and rebooted the pi. After that docker stats started showing the memory usage for the running containers. |
Thank you for sharing this. It works on Raspberry Pi 4 |
Hello, I'm having the same issue... But unfortunately, the
Does anyone have a suggestion? Maybe things have changed since 2016. Thanks! |
I'm also on a Raspberry Pi 4 and this did not solve the problem for me. 😢 I still show 0 memory usage and 0 memory limit for every container. |
What OS are you running? My comment was specific to RaspberryPi OS. |
Found the problem -- an unintended line break that looked like a word-wrap in the cmdline.txt file. Got rid of the line break and all's working correctly. |
I have exactly the same symptoms and reconfiguring grub does not seems to help. Maybe you can recommend some intermediate steps - like what to check and from where, were are my system information:
|
Thank GOD for you. I have looked for hours. |
This is the line I have after launching a sample
docker stats
:docker version
anddocker info
outputs are at the end of this report if needed. But before, let me add that:docker info
.and these are missing compared to the working host:
I've removed other missing 'Optional features' that were explicitely not related (EXT3 feature for example).
One of these missing config value could be the culprit ? If yes, why is it dubbed optional ? can we have a clear warning when launching
docker stats
then ?Here are general information about the failing system:
The system is running in VMWare (client and docker host).
Many thanks,
The text was updated successfully, but these errors were encountered: