Merge pull request #14275 from ankushagarwal/runtime-metrics-docs-stats

Add Docker stats to runtime metrics article
This commit is contained in:
Sebastiaan van Stijn 2015-07-07 08:21:31 +02:00
commit 81964ca555
1 changed files with 21 additions and 3 deletions

View File

@ -2,7 +2,7 @@
+++ +++
title = "Runtime metrics" title = "Runtime metrics"
description = "Measure the behavior of running containers" description = "Measure the behavior of running containers"
keywords = ["docker, metrics, CPU, memory, disk, IO, run, runtime"] keywords = ["docker, metrics, CPU, memory, disk, IO, run, runtime, stats"]
[menu.main] [menu.main]
parent = "smn_administrate" parent = "smn_administrate"
weight = 4 weight = 4
@ -11,6 +11,26 @@ weight = 4
# Runtime metrics # Runtime metrics
## Docker stats
You can use the `docker stats` command to live stream a container's
runtime metrics. The command supports CPU, memory usage, memory limit,
and network IO metrics.
The following is a sample output from the `docker stats` command
$ docker stats redis1 redis2
CONTAINER CPU % MEM USAGE/LIMIT MEM % NET I/O
redis1 0.07% 796 KB/64 MB 1.21% 788 B/648 B
redis2 0.07% 2.746 MB/64 MB 4.29% 1.266 KB/648 B
The [docker stats](/reference/commandline/stats/) reference page has
more details about the `docker stats` command.
## Control groups
Linux Containers rely on [control groups]( Linux Containers rely on [control groups](
https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt) https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt)
which not only track groups of processes, but also expose metrics about which not only track groups of processes, but also expose metrics about
@ -18,8 +38,6 @@ CPU, memory, and block I/O usage. You can access those metrics and
obtain network usage metrics as well. This is relevant for "pure" LXC obtain network usage metrics as well. This is relevant for "pure" LXC
containers, as well as for Docker containers. containers, as well as for Docker containers.
## Control groups
Control groups are exposed through a pseudo-filesystem. In recent Control groups are exposed through a pseudo-filesystem. In recent
distros, you should find this filesystem under `/sys/fs/cgroup`. Under distros, you should find this filesystem under `/sys/fs/cgroup`. Under
that directory, you will see multiple sub-directories, called devices, that directory, you will see multiple sub-directories, called devices,