1

In a Debian 9 Stretch with docker 19.03.1

I'm using 6 containers and I observe swapping of 125Mo while memory usage never exceed 10% of total. ( usually around 500Mo / 16Go ).

for file in /proc/*/status ; do awk '/VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; done | sort -k 2 -n -r | less

give me the following result

dockerd 25160 kB
named 14304 kB
docker-proxy 8144 kB
containerd 7808 kB
docker-proxy 6176 kB
docker-proxy 6100 kB
docker-proxy 4068 kB
docker-proxy 4064 kB
docker-proxy 4064 kB
docker-proxy 4064 kB
docker-proxy 4060 kB
docker-proxy 4060 kB
docker-proxy 3992 kB
docker-proxy 3980 kB
docker-proxy 3940 kB
docker-proxy 3940 kB
docker-proxy 3880 kB
docker-proxy 3824 kB
fail2ban-server 3400 kB
docker-proxy 3088 kB
docker-proxy 2060 kB

It seems docker is swapping a lot. How can i find which container is swapping my host system and how to prevent it ?

Thanks.

idiocrate
  • 23
  • 4
  • docker is using by default as i been correctly informed swap to save ram – djdomi Aug 25 '19 at 14:53
  • @djdomi could you link some documentation regarding this ? Anyway i've been taught to never let a server swap – idiocrate Aug 25 '19 at 15:31
  • i read this here from serval threads, however this might help you as well; https://pgblitz.com/threads/docker-using-swap-memory-instead-of-host-memory-explained.3975/ – djdomi Aug 25 '19 at 15:42
  • *Anyway i've been taught to never let a server swap.* Let go of it. Now you have your own field and enough tooling to fully benefit from self-learning. – kubanczyk Aug 25 '19 at 19:53
  • Wouldn't the process that gets swapped out be the victim of the OS swapping, rather than the cause of it? Seems like you would need to look at what processes overall are using a lot of memory. – BMitch Aug 26 '19 at 18:40

0 Answers0