0

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
  • Please provide enough code so others can better understand or reproduce the problem. Commented Apr 24, 2022 at 13:27

1 Answer 1

0

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)

Sign up to request clarification or add additional context in comments.

1 Comment

I imagine the OP would like other processes to use swap, just not those running under docker.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.