Ad space (banner)
AD

Got the fundamentals? A structured Docker course is a fast way to level up.

Find Docker courses on Udemy

Affiliate link. Costs you nothing extra.

🐳Docker Lessons
Lesson 24 / 45

Monitoring Resources with docker stats

When you want to see how much CPU and memory containers are using, use docker stats. It shows live resource usage.

The syntax is docker stats. Name a container to watch just that one.

Running docker stats displays a continuously updating table of CPU %, memory usage and limit, and network I/O per container.

A common stumble is not setting memory limits, letting one container starve the host. Limits are set with --memory at run time.

In real work, it is how you spot the container responsible when a host suddenly slows down.

Docker
Try it (type this into the pseudo terminal)
docker stats

🧑‍💻 You can type this command into the Docker pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)