1
0
mirror of https://github.com/rancher/os.git synced 2025-08-16 05:54:51 +00:00

Optimize out of memory handling logic

- Use oom_score_adj value -250 for user docker
- Use oom_score_adj for console container
This commit is contained in:
Olli Janatuinen 2020-12-19 19:11:27 +02:00
parent bb62c58b2b
commit b6b68dd1ad
2 changed files with 7 additions and 0 deletions

View File

@ -11,6 +11,12 @@ func (d *DockerConfig) FullArgs() []string {
args := []string{}
args = append(args, generateEngineOptsSlice(d.EngineOpts)...)
args = append(args, d.ExtraArgs...)
// Make sure that OOM killer will kill containers before user docker
// https://github.com/burmilla/os/issues/33
args = append(args, "--oom-score-adjust")
args = append(args, "-250")
if d.TLS {
args = append(args, d.TLSArgs...)
}

View File

@ -251,6 +251,7 @@ rancher:
pid: host
ipc: host
privileged: true
oom_score_adj: -100
restart: always
volumes_from:
- all-volumes