mirror of https://github.com/k3s-io/k3s
dockertools: disable MemorySwap on Linux
According to docker docs, setting MemorySwap equals to Memory can prevent docker containers from using any swap, instead of setting MemorySwap to zero.pull/6/head
parent
6775a3252d
commit
ecc13c8d86
|
@ -104,8 +104,9 @@ func (ds *dockerService) updateCreateConfig(
|
|||
rOpts := lc.GetResources()
|
||||
if rOpts != nil {
|
||||
createConfig.HostConfig.Resources = dockercontainer.Resources{
|
||||
// Memory and MemorySwap are set to the same value, this prevents containers from using any swap.
|
||||
Memory: rOpts.MemoryLimitInBytes,
|
||||
MemorySwap: DefaultMemorySwap(),
|
||||
MemorySwap: rOpts.MemoryLimitInBytes,
|
||||
CPUShares: rOpts.CpuShares,
|
||||
CPUQuota: rOpts.CpuQuota,
|
||||
CPUPeriod: rOpts.CpuPeriod,
|
||||
|
|
Loading…
Reference in New Issue