The standard install of coreos seems to come without a defined swap partition and swap setup.

  • What is the reason for that?
  • Would it be recommended do add swap space in coreos node, which works as kubernetes cluster, running docker containers? Note that the machines will also run glusterfs for persistence of containers.

20+ years ago swap was needed because we had 16meg of ram. So we needed the swap to run applications. These days when we have 32+ gig of ram its not needed as much. Can you created it? Sure.

So what happens these days if you don't. If you don't have a swap partition and you run out of RAM then the OOM in the kernel will pick an application to kill to free up memory.

If you have a swap partition the kernel will select smaller usage apps to roll them over to swap.

You don't need the 2x of RAM anymore as we did in the past.

  • but Swap is needed, swap is not only used when you are out of memory, is used for memory lru – c4f4t0r Jul 11 '17 at 14:34
  • you don't need swap. Its only there as a memory overflow. If you never use it up then you never touch swap. If you don't have a swap partition and you never use up all your RAM when OOM will never be triggered. – Mike Jul 11 '17 at 14:48
  • swap is used in two case, out of memory, where oom is invoked or when the page cached are not used for some time, for this reason some time, you find server using the swap with a lot of free memory, I repeat, swap is not only used when you are in out of memory situation. – c4f4t0r Jul 11 '17 at 15:00
  • sysctl -w vm.swappiness = 0 – takaomag Jul 12 '17 at 0:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.