docker stats
The command that shows live processor, memory, network, disk and process usage for running containers, measured against their limits.
In more detail
The no-stream option prints one sample and exits, which suits scripts. Memory usage is shown next to the container's memory limit, so it is a quick way to see how close a service runs to the point where the kernel would kill it.
Example
docker stats --no-stream --format '{{.MemUsage}}' m07l01-sickRelated terms
- memory limit — The most memory a container may use before the kernel kills a process inside it.
- CPU limit — A cap on how much processor time a container may use, expressed as a number of processors.
- resource limit — A cap on how much memory, processor time or number of processes a container may use.
- OOM killer — The part of the Linux kernel that kills a process when memory runs out.
Taught in
- Environment, Secret Files And Runtime Restrictions — Docker Architecture & Production Containers
- Diagnose Crashes, Resource Limits And Unhealthy Containers — Docker Architecture & Production Containers