问题
Maximum number of threads in my linux system is 93946.
I got this value from cat /proc/sys/kernel/threads-max
.
But when I create around 32768 threads I got error
cannot create new native threads
How can I create maximum number of threads(around 93946)?
If it is not possible to create maximum number of threads (93946), how can I find maximum number of threads allowed to run?
回答1:
You can find max thread with command:
sysctl -a| grep kernel.threads-max
Edit the /etc/sysctl.conf
file and add new value
kernel.threads-max = 93946
Make change effective with sysctl -p
回答2:
please check out /proc/sys/kernel/pid_max. Since threads have their own pid, this value limits the maximum number of threads too.
来源:https://stackoverflow.com/questions/35696399/maximum-number-of-threads-allowed-to-run