Set oom score for containerd and shims
This adds a config option to set the oom score for the containerd daemon as well as automatically setting the oom score for the shim's lauched so that they are not killed until the very end of an out of memory condition. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -51,6 +51,9 @@ func newShim(path string, remote bool) (shim.ShimClient, error) {
|
||||
if err := reaper.Default.Start(cmd); err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to start shim")
|
||||
}
|
||||
if err := sys.SetOOMScore(cmd.Process.Pid, sys.OOMScoreMaxKillable); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return connectShim(socket)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user