]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
man: make it clear how systemd calculate the DefaultTasksMax.
authorEinsler Lee <shenxiaogll@163.com>
Sat, 30 Jan 2021 03:14:35 +0000 (11:14 +0800)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 30 Jan 2021 11:48:15 +0000 (12:48 +0100)
Actually, systemd takes the minimum of
* a) the maximum tasks value the kernel allows on this architecture
* b) the cgroups pids_max attribute for the system
* c) the kernel's configured maximum PID value
to calculate the DefaultTasksMax. Here, kernel.thread-max should also be methioned.

man/systemd-system.conf.xml

index 0dea50f2fe87591faef8201034399c927f0864cf..075666ac6b0814190846f104e5268235ef326887 100644 (file)
         <listitem><para>Configure the default value for the per-unit <varname>TasksMax=</varname> setting. See
         <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>
         for details. This setting applies to all unit types that support resource control settings, with the exception
-        of slice units. Defaults to 15% of the sysctl setting <varname>kernel.pid_max=</varname> or root cgroup <varname>pids.max</varname>.
+        of slice units. Defaults to 15% of the minimum of <varname>kernel.pid_max=</varname>, <varname>kernel.threads-max=</varname>
+        and root cgroup <varname>pids.max</varname>.
         Kernel has a default value for <varname>kernel.pid_max=</varname> and an algorithm of counting in case of more than 32 cores.
         For example with the default <varname>kernel.pid_max=</varname>, <varname>DefaultTasksMax=</varname> defaults to 4915,
         but might be greater in other systems or smaller in OS containers.</para></listitem>