# docker stats: Live Container Resource Usage

> How docker stats works: streaming CPU, memory, network, and I/O per container, the --no-stream flag, and spotting OOM in CI.

Source: https://latchkey.dev/learn/command-reference/docker-stats-command  
Updated: 2026-06-25

Watch live CPU and memory usage per container.

docker stats streams a live view of resource usage per running container. This page covers the one-shot --no-stream mode used in CI and reading memory pressure.

## What it does

docker stats shows CPU %, memory usage/limit, network I/O, and block I/O for running containers, refreshing continuously. --no-stream prints a single snapshot, which is what you want in non-interactive CI.

## Common usage

```Terminal
docker stats
docker stats --no-stream
docker stats --no-stream --format "{{.Name}} {{.MemUsage}} {{.CPUPerc}}"
docker stats web db
```

## Common errors in CI

Plain docker stats never returns in CI because it streams forever and there is no TTY to interrupt it - always add --no-stream in pipelines. If MEM USAGE / LIMIT shows usage approaching the limit, the container is heading for an OOM kill (exit 137); raise --memory or fix the leak. Stopped containers do not appear in stats.

## FAQ

### docker stats: Live Container Resource Usage?

docker stats streams a live view of resource usage per running container. This page covers the one-shot --no-stream mode used in CI and reading memory pressure.

### What it does?

docker stats shows CPU %, memory usage/limit, network I/O, and block I/O for running containers, refreshing continuously. --no-stream prints a single snapshot, which is what you want in non-interactive CI.

### Common errors in CI?

Plain docker stats never returns in CI because it streams forever and there is no TTY to interrupt it - always add --no-stream in pipelines. If MEM USAGE / LIMIT shows usage approaching the limit, the container is heading for an OOM kill (exit 137); raise --memory or fix the leak. Stopped containers do not appear in stats.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
