Skip to main content

Containers Monitoring

Containers Monitoring

There're several commands that may be useful for monitoring state of all docker containers running on the Control Server host.

List of the containers

The docker ps command shows only running containers by default. To see all containers, use the -a (or --all) flag

$ docker ps -a
CONTAINER ID   IMAGE COMMAND                                             CREATED          STATUS         PORTS                      NAMES
712ca7efaecf   harbor.itd.iba.by/easyrpa/rpa-ui                          6 minutes ago    Up 6 minutes   80/tcp                     rpa-ui
e0df74960a56   harbor.itd.iba.by/easyrpa/easyrpa-control-server:latest   17 hours ago     Up 17 hours    9000/tcp                   cs
59af0464461d   nginx "/docker-entrypoint.…"                              2 days ago       Up 2 days      0.0.0.0:443->443/tcp...    nginx
0da059cb3a96   vault:1.4.2 "docker-entrypoint.s…"                        2 days ago       Up 2 days      8200/tcp                   vault
d3ce3a80500c   docker.elastic.co/elasticsearch/elasticsearch-oss:7.8.1   2 days ago       Up 2 days      9200/tcp, 9300/tcp         elasticsearch
f272200ccd64   mongo:4.2.7 "docker-entrypoint.s…"                        2 days ago       Up 2 days      0.0.0.0:27017->27017/tcp   mongodb
774103b56e01   docker.elastic.co/kibana/kibana-oss:7.8.1                 2 days ago       Up 2 days      5601/tcp                   kibana
f73d00e07b4b   rmohr/activemq:5.15.9 "/bin/sh -c 'bin/act…"              2 days ago       Up 2 days      1883/tcp, 5672/tcp...      activemq
b1c3610d6efb   postgres:9.5 "docker-entrypoint.s…"                       2 days ago       Up 2 days      5432/tcp                   postgres
4d31325c1082   minio/minio "/usr/bin/docker-ent…"                        2 days ago       Up 2 days      9000/tcp                   minio
b6b8c2db5d40   sonatype/nexus3 "sh -c ${SONATYPE_DI…"                    2 days ago       Up 2 days      0.0.0.0:8081->8081/tcp     nexus

Disk usage by the containers

The docker ps -s command displays two different on-disk-sizes for each container. 

  • The “size” information shows the amount of data (on disk) that is used for the writable layer of each container
  • The “virtual size” is the total amount of disk-space used for the read-only image data used by the container and the writable layer.
$ docker ps -s --format "table {{.ID}}\t{{.Names}}\t{{.Status}}\t{{.Size}}"
CONTAINER ID   NAMES           STATUS          SIZE
712ca7efaecf   rpa-ui          Up 20 minutes   58B (virtual 159MB)
e0df74960a56   cs              Up 17 hours     43.7kB (virtual 792MB)
59af0464461d   nginx           Up 2 days       1.12kB (virtual 133MB)
0da059cb3a96   vault           Up 2 days       131MB (virtual 270MB)
d3ce3a80500c   elasticsearch   Up 2 days       30.8MB (virtual 729MB)
f272200ccd64   mongodb         Up 2 days       0B (virtual 388MB)
774103b56e01   kibana          Up 2 days       38B (virtual 835MB)
f73d00e07b4b   activemq        Up 2 days       33.9MB (virtual 407MB)
b1c3610d6efb   postgres        Up 2 days       70B (virtual 196MB)
4d31325c1082   minio           Up 2 days       0B (virtual 62.1MB)
b6b8c2db5d40   nexus           Up 2 days       32.9kB (virtual 632MB)

Resource usage statistics

The docker stats command returns a live data stream for running containers. To limit data you can specify a list of container names or ids separated by a space.

$ docker stats
CONTAINER ID   NAME           CPU %   MEM USAGE / LIMIT     MEM %   NET I/O           BLOCK I/O   PIDS
712ca7efaecf   rpa-ui         0.00%   1.641MiB / 31.26GiB   0.01%   30kB / 2.12MB     0B / 0B     3
e0df74960a56   cs             2.52%   1.56GiB / 31.26GiB    4.99%   1.83GB / 1.05GB   0B / 0B     50
59af0464461d   nginx          2.41%   4.602MiB / 31.26GiB   0.01%   1.99GB / 2.5GB    0B / 0B     5
0da059cb3a96   vault          0.08%   102.8MiB / 31.26GiB   0.32%   5.94MB / 8.51MB   0B / 0B     11
d3ce3a80500c   elasticsearch  0.91%   834.7MiB / 31.26GiB   2.61%   892MB / 612MB     0B / 0B     54
f272200ccd64   mongodb        0.38%   73.59MiB / 31.26GiB   0.23%   4.57MB / 6.33MB   0B / 0B     34
774103b56e01   kibana         0.21%   102.4MiB / 31.26GiB   0.32%   23.6MB / 25.3MB   0B / 0B     12
f73d00e07b4b   activemq       0.20%   331.7MiB / 31.26GiB   1.04%   51.7MB / 52.4MB   0B / 0B     46
b1c3610d6efb   postgres       0.00%   5.27MiB / 31.26GiB    0.02%   914MB / 1.97GB    0B / 0B     8
4d31325c1082   minio          0.00%   25.27MiB / 31.26GiB   0.08%   480kB / 430MB     0B / 0B     9
b6b8c2db5d40   nexus          0.93%   1.626GiB / 31.26GiB   5.20%   1.71GB / 2.27GB   0B / 0B     112