From e3f04f5d205c7f984d6431fa54120eebe0be7c31 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Mon, 11 Jul 2016 15:26:23 -0700 Subject: [PATCH] Add --oom-score-adjust to daemon This adds an `--oom-score-adjust` flag to the daemon so that the value provided can be set for the docker daemon's process. The default value for the flag is -500. This will allow the docker daemon to have a less chance of being killed before containers do. The default value for processes is 0 with a min/max of -1000/1000. -500 is a good middle ground because it is less than the default for most processes and still not -1000 which basically means never kill this process in an OOM condition on the host machine. The only processes on my machine that have a score less than -500 are dbus at -900 and sshd and xfce( my window manager ) at -1000. I don't think docker should be set lower, by default, than dbus or sshd so that is why I chose -500. Signed-off-by: Michael Crosby --- docs/reference/commandline/dockerd.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/reference/commandline/dockerd.md b/docs/reference/commandline/dockerd.md index 02acdc9468..65a2f5406b 100644 --- a/docs/reference/commandline/dockerd.md +++ b/docs/reference/commandline/dockerd.md @@ -54,9 +54,10 @@ weight = -1 --label=[] Set key=value labels to the daemon --log-driver="json-file" Default driver for container logs --log-opt=[] Log driver specific options - --mtu=0 Set the containers network MTU --max-concurrent-downloads=3 Set the max concurrent downloads for each pull --max-concurrent-uploads=5 Set the max concurrent uploads for each push + --mtu=0 Set the containers network MTU + --oom-score-adjust=-500 Set the oom_score_adj for the daemon --disable-legacy-registry Do not contact legacy registries -p, --pidfile="/var/run/docker.pid" Path to use for daemon PID file --raw-logs Full timestamps without ANSI coloring @@ -1057,6 +1058,7 @@ This is a full example of the allowed configuration options on Linux: "insecure-registries": [], "disable-legacy-registry": false, "default-runtime": "runc", + "oom-score-adjust": -500, "runtimes": { "runc": { "path": "runc"