Recently I was asked to provide a list of the resource usage of all Docker containers which were running on a specific node. To get this information I had to do the following:
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
I used the following Docker command:
You can change the
--all
with-a
which would do the same.This command would provide you to a nice live stream of very useful information like the CPU usage, the RAM usage, the NET I/O and more. The output would looke something like this:
That way you could find out which container is using most of the resources on your server and possibly implement some resource limitations.
If you would like to check the resource usage for a specific container you could run:
If you would like to see only specific columns, you could use the
--format
argument:This would return something like:
Here is a quick video demo on how to do that as well:
For more information, I would suggest checking the official documentation here:
https://docs.docker.com/engine/reference/commandline/stats/
Hope that this helps! Regards, Bobby