Why is using host memory recommended by docker

Viewed 153

I am investigating a topic, which I will call “Docker swarm and memory management”.

It states in this article here that docker does not recommend using swap memory, but I can’t find (googling) a place where disadvantages of using swap memory in docker context is explained.

Can a kind soul enlighten me? :-)

1 Answers

It is normal to disable SWAP memory in ALL applications or services that are used in production.

SWAP memory is based on using the hard disk as a substitute when the RAM is full. This may seem beneficial but the RAM has a speed from 2.1 GB/s the oldest to 25.6 GB/s the newest. Contrary to the speed of a hard drive with HDDs on average at 135MB/s, newer M.2 SSDs at 1.2GB/s.

As we can see we would be greatly slowing down the service if we were using SWAP.

Related