One of our Docker hosts is swapping like hell for no reason - at least, no apparent one (it's a Ubuntu 16.04LTS VM). All Docker containers in summary only use ~4 GB of the 12GB RAM total, but the system uses 10GB of physical RAM in addition to 6GB of swap.
What can cause this? The "big ones" are one instance of sonatype/nexus3
and one instance of gitlab/gitlab-ce
. When looking at the processes in htop and sorting by MEM%
, nothing out of the ordinary appears, especially nothing in the 14GB range that is being "used" somewhere.
xxx@docker-static:~$ free -m
total used free shared buff/cache available
Mem: 12015 10441 563 537 1010 670
Swap: 11670 6623 5047
xxx@docker-static:~$ docker stats --no-stream
CONTAINER CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
18c956010080 0.81% 541.9MiB / 11.73GiB 4.51% 82.1GB / 3.8TB 149GB / 2.25GB 230
35ec9741be74 0.48% 1.887MiB / 11.73GiB 0.02% 22.1MB / 30.1MB 8.82GB / 5.57MB 8
e90b429c45f4 0.00% 68KiB / 11.73GiB 0.00% 10.5MB / 23kB 19.4MB / 11.2MB 1
091fd79b7b3c 19.17% 1.908GiB / 11.73GiB 16.26% 6.36GB / 526GB 985GB / 43.7GB 353
a1e0dd98679f 0.53% 924.2MiB / 11.73GiB 7.69% 83.9GB / 37.5GB 347GB / 9.98GB 182
1d5368d1ce24 0.25% 60.54MiB / 11.73GiB 0.50% 40.1GB / 112GB 102GB / 2.7GB 12
a0aba32126ec 0.00% 56KiB / 11.73GiB 0.00% 17.1MB / 9.48MB 6.25GB / 18.5MB 4
cc9065d65372 0.00% 256KiB / 11.73GiB 0.00% 1.12MB / 92.6kB 3.07GB / 12.3MB 2
92cb16f6bfc8 0.04% 6.031MiB / 11.73GiB 0.05% 13.1TB / 13.1TB 21.6GB / 1.81GB 4