mirror of
https://github.com/rancher/os.git
synced 2025-08-16 22:08:26 +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:
parent
bb62c58b2b
commit
b6b68dd1ad
@ -11,6 +11,12 @@ func (d *DockerConfig) FullArgs() []string {
|
|||||||
args := []string{}
|
args := []string{}
|
||||||
args = append(args, generateEngineOptsSlice(d.EngineOpts)...)
|
args = append(args, generateEngineOptsSlice(d.EngineOpts)...)
|
||||||
args = append(args, d.ExtraArgs...)
|
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 {
|
if d.TLS {
|
||||||
args = append(args, d.TLSArgs...)
|
args = append(args, d.TLSArgs...)
|
||||||
}
|
}
|
||||||
|
@ -251,6 +251,7 @@ rancher:
|
|||||||
pid: host
|
pid: host
|
||||||
ipc: host
|
ipc: host
|
||||||
privileged: true
|
privileged: true
|
||||||
|
oom_score_adj: -100
|
||||||
restart: always
|
restart: always
|
||||||
volumes_from:
|
volumes_from:
|
||||||
- all-volumes
|
- all-volumes
|
||||||
|
Loading…
Reference in New Issue
Block a user