天天看點

How can I monitor how much resources all containers are using on RHEL 8?

How can I monitor how much resources all containers are using on RHEL 8?

 SOLUTION IN PROGRESS - 已更新 2019年三月1日07:38 - 

​​English ​​

環境

  • Red Hat Enterprise Linux 8

問題

  • I need to see how much resources every running container on a RHEL 8 system is using.
  • How can I monitor CPU, memory, disk, and network resources containers are using in real time?

決議

  • Use ​

    ​podman stats​

    ​ to view real-time resource consumption for containers running on RHEL 8.
  • Using the ​

    ​--all​

    ​ option provides output for all running containers
  • Using ​

    ​--no-stream​

    ​ will do a 1-second poll, report the container's resource details and then exit, otherwise ​

    ​podman stats​

    ​ will continue to poll until interrupted.
# podman stats --all --no-stream
ID             NAME               CPU %   MEM USAGE / LIMIT   MEM %   NET IO              BLOCK IO     PIDS
810ad5d7bf99   fervent_thompson   --      876.5kB / 500.2MB   0.18%   1.048kB / 1.186kB   340kB / 0B   1      

繼續閱讀