Raise allowed systemd cgroup process limits
In https://gitlab.com/gitlab-org/gitlab-ce/issues/58120, a user complained GitLab starting showing lots of error 500s with messages such as can't create Thread: Resource temporarily unavailable>
.
It turns out in Ubuntu 16.04, versions of systemd older than ubuntu/229-4ubuntu6
had a default of 512
in DefaultTaskMax
set in /etc/systemd/system.conf
. This number can be adjusted as described in https://wiki.ubuntu.com/ppc64el/Recommendations#Max_pids_on_Ubuntu_16.04. There is more discussion in the systemd issue: https://github.com/systemd/systemd/issues/3211#issue-153565345.
The version of systemd on GitLab.com (229-4ubuntu21.16
) has this set to infinity via the Debian patch: https://salsa.debian.org/systemd-team/systemd/blob/ubuntu/229-4ubuntu13/debian/patches/Revert-core-enable-TasksMax-for-all-services-by-default-a.patch:
$ systemctl show --property=DefaultTasksMax
DefaultTasksMax=18446744073709551615
In Ubuntu 18.04, it looks like DefaultTasksMax
has been lowered to a default of 4915. We should probably raise this to a much higher number because in a single-node instance, Gitaly and PostgreSQL may fork a number of processes.
@jplum
says:
This should be a simple addition to the systemd
.service
file, I would think, since that usesgitlab-runsvdir
I think this is a blocker for GitLab.com to even consider Ubuntu 18.04.