Linux Docker uses excessive memory

Issue:

  • I have a 16G memory and configured swap as 16G.
  • When start mysql docker, mysqld uses crazy amount of memory and make the system freeze.

References:

Solution

$ sudo sysctl -a |grep 'vm.swapp*\|vm.over*'
$ sudo sysctl vm.swappiness=0
$ sudo sysctl vm.overcommit_memory=1
$ sudo sysctl -a |grep 'vm.swapp*\|vm.over*'
$ cat /proc/sys/vm/overcommit_memory
$ cat /proc/sys/vm/swappiness

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.