Merge pull request #724 from crosbymichael/oom-score
Set oom score for containerd and shims
This commit is contained in:
@@ -53,6 +53,8 @@ type config struct {
|
||||
Plugins map[string]toml.Primitive `toml:"plugins"`
|
||||
// Enable containerd as a subreaper
|
||||
Subreaper bool `toml:"subreaper"`
|
||||
// OOMScore adjust the containerd's oom score
|
||||
OOMScore int `toml:"oom_score"`
|
||||
|
||||
md toml.MetaData
|
||||
}
|
||||
|
||||
@@ -29,6 +29,12 @@ func platformInit(context *cli.Context) error {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if conf.OOMScore != 0 {
|
||||
log.G(global).Infof("changing OOM score to %d", conf.OOMScore)
|
||||
if err := sys.SetOOMScore(os.Getpid(), conf.OOMScore); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user