Disable oomkiller just for smaller containers
This commit is contained in:
parent
ed5061fd58
commit
072a643c1d
@ -338,7 +338,10 @@ func (d *Driver) Create(name string, image string, volumePath string, HTTPPort i
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
trueValue := true
|
OOMKillDisable := false
|
||||||
|
if memory < 250 {
|
||||||
|
OOMKillDisable = true
|
||||||
|
}
|
||||||
|
|
||||||
createdContainer, err := cli.ContainerCreate(
|
createdContainer, err := cli.ContainerCreate(
|
||||||
context.Background(),
|
context.Background(),
|
||||||
@ -358,7 +361,7 @@ func (d *Driver) Create(name string, image string, volumePath string, HTTPPort i
|
|||||||
CPUQuota: int64(CPU) * 1000,
|
CPUQuota: int64(CPU) * 1000,
|
||||||
Memory: int64(memory*110/100) * 1024 * 1024, // Allow 10 % more memory so we have space for MemoryReservation
|
Memory: int64(memory*110/100) * 1024 * 1024, // Allow 10 % more memory so we have space for MemoryReservation
|
||||||
MemoryReservation: int64(memory) * 1024 * 1024, // This should provide softer way how to limit the memory of our containers
|
MemoryReservation: int64(memory) * 1024 * 1024, // This should provide softer way how to limit the memory of our containers
|
||||||
OomKillDisable: &trueValue,
|
OomKillDisable: &OOMKillDisable,
|
||||||
},
|
},
|
||||||
PortBindings: portBindings,
|
PortBindings: portBindings,
|
||||||
AutoRemove: false,
|
AutoRemove: false,
|
||||||
|
Loading…
Reference in New Issue
Block a user