I need docker instance to NOT utilize the host swap

1.5k views Asked by At

My server build uses a lot of swap per container and I am told that docker uses the host swap for instances. My host ssd is only 256gb and is only intended to run the OS. I have setup a zfs pool (9 Tb and growing...) for docker and wanted it to use a portion of it for swap since each instance needs 768k of swap and we plan on running 4k instances.

How can I configure docker to utilize some kind of custom zpool swap dedicated space?

1

There are 1 answers

0
Bguess On

Why don't you simply disable the swap?

  1. Identify configured swap devices and files with cat /proc/swaps.
  2. Turn off all swap devices and files with swapoff -a.
  3. Remove any matching reference found in /etc/fstab.
  4. Optional: Destroy any swap devices or files found in step 1 to prevent their reuse. Due to your concerns about leaking sensitive information, you may wish to consider performing some sort of secure wipe. man swapoff

(from here https://serverfault.com/questions/684771/best-way-to-disable-swap-in-linux)