Ubuntu 24.04
Sponsored Link

Docker : Display Container resource usage2024/06/13

 

You can check percentage of CPU, memory, network I/O for Containers.

[1] Check the resource usage of each container.
# display usage statistics with streaming

root@dlp:~#
docker stats

CONTAINER ID   NAME                 CPU %     MEM USAGE / LIMIT     MEM %     NET I/O     BLOCK I/O     PIDS
a4e5da3f4772   trusting_keller      0.00%     5.945MiB / 15.62GiB   0.04%     586B / 0B   0B / 4.1kB    9
830891a41930   infallible_davinci   0.00%     6.039MiB / 15.62GiB   0.04%     946B / 0B   0B / 8.19kB   56

# display without streaming

root@dlp:~#
docker stats --no-stream

CONTAINER ID   NAME                 CPU %     MEM USAGE / LIMIT     MEM %     NET I/O       BLOCK I/O     PIDS
a4e5da3f4772   trusting_keller      0.00%     5.945MiB / 15.62GiB   0.04%     726B / 0B     0B / 4.1kB    9
830891a41930   infallible_davinci   0.00%     6.039MiB / 15.62GiB   0.04%     1.02kB / 0B   0B / 8.19kB   56

# display for a specific container

root@dlp:~#
docker stats 830891a41930 --no-stream

CONTAINER ID   NAME                 CPU %     MEM USAGE / LIMIT     MEM %     NET I/O       BLOCK I/O     PIDS
830891a41930   infallible_davinci   0.00%     6.039MiB / 15.62GiB   0.04%     1.02kB / 0B   0B / 8.19kB   56

# display with specific format

root@dlp:~#
docker stats --no-stream --format "table {{.ID}} {{.CPUPerc}} {{.MemPerc}}"

CONTAINER ID CPU % MEM %
a4e5da3f4772 0.00% 0.04%
830891a41930 0.00% 0.04%
Matched Content