maximum number of threads allowed to run

自古美人都是妖i 提交于 2019-12-08 04:44:43

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!