Max PID in 20.04 increased to 4194304
Colin Watson
cjwatson at ubuntu.com
Sun Apr 26 10:22:04 UTC 2020
On Sat, Apr 25, 2020 at 09:29:45PM -0400, Walt Mankowski wrote:
> I upgraded from 19.10 to 20.04 earlier today. Later on I ran ps and
> was surprised when I saw some very large process IDs. It looks like
> the default maximum PID (set in /proc/sys/kernel/pid_max) has
> increased from 32767 to 4194304.
>
> I don't see this new behavior mentioned in the release notes at
> https://wiki.ubuntu.com/FocalFossa/ReleaseNotes. Was it intentional?
Yes - it's in the NEWS file for systemd 243 (there are far too many
changes in a two-year LTS release cycle to be able to reproduce all of
them in the overall release notes):
* On 64 bit systems, the "kernel.pid_max" sysctl is now bumped to
4194304 by default, i.e. the full 22bit range the kernel allows, up
from the old 16bit range. This should improve security and
robustness, as PID collisions are made less likely (though certainly
still possible). There are rumours this might create compatibility
problems, though at this moment no practical ones are known to
us. Downstream distributions are hence advised to undo this change in
their builds if they are concerned about maximum compatibility, but
for everybody else we recommend leaving the value bumped. Besides
improving security and robustness this should also simplify things as
the maximum number of allowed concurrent tasks was previously bounded
by both "kernel.pid_max" and "kernel.threads-max" and now effectively
only a single knob is left ("kernel.threads-max"). There have been
concerns that usability is affected by this change because larger PID
numbers are harder to type, but we believe the change from 5 digits
to 7 digits doesn't hamper usability.
Seems like a basically good idea to me.
--
Colin Watson [cjwatson at ubuntu.com]
More information about the ubuntu-users
mailing list