Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to count the status of Docker container resources?

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Before we begin

How do I count the resource information occupied by a container?

Docker provides the stats subcommand to understand the resource usage of the current running container, including: CPU, memory, network IO, disk IO, and so on.

Environment description

Docker 1.10.3 on CentOS 7

This version of Docker is very old and can not be found at present. In addition, Ubuntu Server 16.04 LTS is recommended for Linux host operating system Docker, which can better support advanced features such as overlay2 storage driver.

For instance

1. All container status information is output by default

Docker stats# uses Ctrl + C to exit statistics

two。 Outputs the specified container status information

Docker stats nginx# uses Ctrl + C to exit statistics

3. Or you can output the result only once.

Docker stats-- no-stream nginx command helps docker stats-- helpUsage: docker stats [OPTIONS] [CONTAINER...] Display a live stream of container (s) resource usage statistics-a,-- all Show all containers (default shows just running)-- help Print usage-- no-stream Disable streaming stats and only pull the first result summary

Finally, let's summarize the knowledge points in the article.

Learn about the resource usage of the currently running container through the docker stats subcommand. Output real-time statistics by default and exit using Ctrl + C key. Parameter-no-stream means that real-time statistics are disabled and only the results obtained for the first time are used.

Reference article

Doker&k8s Qun [703906133]

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report