From 02b6af2e96e1062cee56fd640a462afb30513dec Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Thu, 18 Jan 2018 21:52:51 -0800 Subject: [PATCH] rpm/fedora-2x/spec: enable TasksMax in service file Since systemd version 228, a new setting, `TasksMax`, has appeared, which limits the number of tasks used by a service (via pids cgroup controller). Unfortunately, a default for this setting, `DefaultTaskMax`, is set to 512. In systemd version 231 it is changed to 15% which practically is 4195, as the value from /proc/sys/kernel/pid_max is treated like 100%). Either 512 or 4195 is severily limited value for Docker Engine, as it can run thousands of containers with thousands of tasks in each, and the number of tasks limit should be set on a per-container basis by the Docker user. So, the most reasonable setting for `TasksMax` is `unlimited`. Unfortunately, older versions of systemd warn about unknown `TasksMax` parameter in `docker.service` file, and the warning is rather annoying, therefore this setting is commented out by default, and is supposed to be uncommented by the user. The problem with that is, once the limit is hit, all sorts of bad things happen and it's not really clear even to an advanced user that this setting is the source of issues. As Fedora 25 ships systemd 231, it (and later Fedora releases) support TasksMax, so it makes total sense to uncomment the setting, this is what this commit does. Signed-off-by: Kir Kolyshkin Upstream-commit: 9055832bb0725f05d518c3ebc9b7cc93a69420c7 Component: packaging --- components/packaging/rpm/fedora-26/docker-ce.spec | 2 ++ components/packaging/rpm/fedora-27/docker-ce.spec | 2 ++ 2 files changed, 4 insertions(+) diff --git a/components/packaging/rpm/fedora-26/docker-ce.spec b/components/packaging/rpm/fedora-26/docker-ce.spec index 37e1ccf37d..1b4a66d676 100644 --- a/components/packaging/rpm/fedora-26/docker-ce.spec +++ b/components/packaging/rpm/fedora-26/docker-ce.spec @@ -103,6 +103,8 @@ install -p -m 644 engine/contrib/udev/80-docker.rules $RPM_BUILD_ROOT/%{_sysconf install -d $RPM_BUILD_ROOT/etc/sysconfig install -d $RPM_BUILD_ROOT/%{_initddir} install -d $RPM_BUILD_ROOT/%{_unitdir} +# Fedora 25+ supports (and needs) TasksMax +sed -i 's/^#TasksMax=/TasksMax=/' /systemd/docker.service install -p -m 644 /systemd/docker.service $RPM_BUILD_ROOT/%{_unitdir}/docker.service # add bash, zsh, and fish completions install -d $RPM_BUILD_ROOT/usr/share/bash-completion/completions diff --git a/components/packaging/rpm/fedora-27/docker-ce.spec b/components/packaging/rpm/fedora-27/docker-ce.spec index 2c86cac2d9..3728eae15a 100644 --- a/components/packaging/rpm/fedora-27/docker-ce.spec +++ b/components/packaging/rpm/fedora-27/docker-ce.spec @@ -104,6 +104,8 @@ install -p -m 644 engine/contrib/udev/80-docker.rules $RPM_BUILD_ROOT/%{_sysconf install -d $RPM_BUILD_ROOT/etc/sysconfig install -d $RPM_BUILD_ROOT/%{_initddir} install -d $RPM_BUILD_ROOT/%{_unitdir} +# Fedora 25+ supports (and needs) TasksMax +sed -i 's/^#TasksMax=/TasksMax=/' /systemd/docker.service install -p -m 644 /systemd/docker.service $RPM_BUILD_ROOT/%{_unitdir}/docker.service # add bash, zsh, and fish completions install -d $RPM_BUILD_ROOT/usr/share/bash-completion/completions