Skip to content

Commit

Permalink
wip: update service files to match upstream
Browse files Browse the repository at this point in the history
* MountFlags=slave
  preventing us from using live restore functionality
  moby/moby#22806 (comment)
  https://access.redhat.com/articles/2938171

* LimitNOFILE=infinity LimitNPROC=infinity
  not-insignificant performance overhead due to
  limits being propagated to all children (containerd + containers)
  moby/moby@8db6109

* Delegate=yes
  allow docker to manage it's cgroup subtree without systemd
  interference
  moby/moby#20152
  moby/moby@d16737f

* TasksMax=infinity
  prevent systemd from setting a default task limit of 512 on the engine
  cgroup, on linux >=4.3
  systemd/systemd#1239
  systemd/systemd#1886

Signed-off-by: Robert Günzler <robertg@balena.io>
  • Loading branch information
robertgzr committed May 27, 2020
1 parent fe6ccc6 commit fb2b63e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@ EnvironmentFile=-/etc/docker/balenahost.env
ExecStart=/usr/bin/balenad --delta-data-root=/mnt/sysroot/active/balena --delta-storage-driver=@BALENA_STORAGE@ --log-driver=journald -s @BALENA_STORAGE@ --data-root=/mnt/sysroot/inactive/balena -H fd:// --pidfile=/var/run/balena-host.pid --exec-root=/var/run/balena-host --bip 10.114.101.1/24 --fixed-cidr=10.114.101.128/25 --iptables=false --max-download-attempts=10 --exec-opt native.cgroupdriver=systemd
#Adjust OOMscore to -900 to make killing unlikely
OOMScoreAdjust=-900
MountFlags=slave
LimitNOFILE=1048576
LimitNPROC=1048576
LimitNPROC=infinity
LimitCORE=infinity
TasksMax=infinity
TimeoutStartSec=0
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=30s
Delegate=yes
KillMode=process

Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ ExecStart=/usr/bin/healthdog --healthcheck=/usr/lib/balena/balena-healthcheck /u
ExecStartPost=/bin/bash -c '/usr/lib/balena/balena-healthcheck-image-load &'
#Adjust OOMscore to -900 to make killing unlikely
OOMScoreAdjust=-900
MountFlags=slave
LimitNOFILE=1048576
LimitNPROC=1048576
LimitNPROC=infinity
LimitCORE=infinity
TasksMax=infinity
TimeoutStartSec=0
WatchdogSec=360
Restart=always
StartLimitBurst=3
StartLimitInterval=30s
Delegate=yes
KillMode=process

[Install]
Expand Down

0 comments on commit fb2b63e

Please sign in to comment.