Monitor Resource Usage of Docker Containers

Monitor Resource Usage of Docker Containers

Monitoring resource usage of the system is an important task that can help for troubleshooting issues. Docker provides a built-in monitoring solution. This tutorial demonstrates how to monitor resource usage of Docker containers.

Resource usage of all running containers

To monitor resource usage of all running containers, use docker stats command or docker container command with stats argument.

docker stats
docker container stats

Output example:

CONTAINER ID   NAME      CPU %     MEM USAGE / LIMIT     MEM %     NET I/O      BLOCK I/O         PIDS
647fb18e7e32   nginx     0.00%     11.38MiB / 11.66GiB   0.10%     1.6kB / 0B   20.7MB / 8.19kB   9
81d74f2e054e   redis     0.18%     3.035MiB / 11.66GiB   0.03%     656B / 0B    139kB / 0B        5

Command shows CPU usage, memory usage and limit, network I/O, and disk I/O.

Resource usage of specific containers

Also, possible to monitor resource usage of single or multiple containers by providing a list of space-separated container IDs or names.

docker stats nginx redis
docker container stats nginx redis

Leave a Comment

Cancel reply

Your email address will not be published.