Improve system behavior on low memory situation (#3781)

* Improve system behavior on low memory situation

Adjust OOM killer score to prevent crucial services from getting
selected.

* Adjust OOM score of DNS plug-in as well
This commit is contained in:
Stefan Agner 2022-08-23 16:02:51 +02:00 committed by GitHub
parent b4e1e3e853
commit 9c7de4a6c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 0 deletions

View File

@ -489,6 +489,7 @@ class DockerAddon(DockerInterface):
environment=self.environment,
volumes=self.volumes,
tmpfs=self.tmpfs,
oom_score_adj=200,
)
except DockerNotFound:
self.sys_resolution.create_issue(

View File

@ -50,6 +50,7 @@ class DockerDNS(DockerInterface, CoreSysAttributes):
str(self.sys_config.path_extern_dns): {"bind": "/config", "mode": "rw"},
DBUS_PATH: DBUS_VOLUME,
},
oom_score_adj=-300,
)
self._meta = docker_container.attrs

View File

@ -149,6 +149,7 @@ class DockerHomeAssistant(DockerInterface):
ENV_TOKEN_OLD: self.sys_homeassistant.supervisor_token,
},
tmpfs={"/tmp": ""},
oom_score_adj=-300,
)
self._meta = docker_container.attrs

View File

@ -55,6 +55,7 @@ class DockerObserver(DockerInterface, CoreSysAttributes):
},
volumes={"/run/docker.sock": {"bind": "/run/docker.sock", "mode": "ro"}},
ports={"80/tcp": 4357},
oom_score_adj=-300,
)
self._meta = docker_container.attrs