简体   繁体   中英

I need docker instance to NOT utilize the host swap

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?

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 )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM