At boot, the kernel adjusts the default pid_max
depending on the number of CPUs available. When the number is low, the usual 32768 is selected. Else the calculation is done as follows (showing here a 3.10 kernel to be similar to RHEL but beside some variations it's the same for any recent Linux kernel):
include/linux/threads.h
:
/*
* This controls the default maximum pid allocated to a process
*/
#define PID_MAX_DEFAULT (CONFIG_BASE_SMALL ? 0x1000 : 0x8000)
0x8000 = 32768 is the usual value used on systems with less than 32 cpu threads available.
and later:
#define PIDS_PER_CPU_DEFAULT 1024
Those values are then used in kernel/pid.c
:
int pid_max = PID_MAX_DEFAULT;
and later:
/* bump default and minimum pid_max based on number of cpus */
pid_max = min(pid_max_max, max_t(int, pid_max,
PIDS_PER_CPU_DEFAULT * num_possible_cpus()));
pid_max_min = max_t(int, pid_max_min,
PIDS_PER_CPU_MIN * num_possible_cpus());
pr_info("pid_max: default: %u minimum: %u\n", pid_max, pid_max_min);
So from OP this should mean a total of 458752/1024 = 448 simultaneous threads available: quite a lot. The other system has probably not as many CPUs/cores/threads etc., so has a lower default pid_max
.
kernel_pid_max
in yoursysctl.conf
because it should bekernel.pid_max
. – JRFerguson Feb 12 '19 at 22:23