In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Xiaobian to share with you how to limit the total number of threads in the Linux system, I believe most people still do not know how to share this article for your reference, I hope you have a lot of harvest after reading this article, let's go to understand it together!
1. Summarize the system limitations: /proc/sys/kernel/pid_max #Check the maximum number of threads supported by the system, which is generally large, equivalent to the theoretical value.
/proc/sys/kernel/threads-max
max_user_process #The system limits the maximum number of processes or threads a user can run, using the command:ulimit -u
Note: To modify the max_user_process value, you only need to modify/etc/security/limits.conf, but this parameter needs to modify/etc/security/limits.d/90-nproc.conf
Appendix 1: Centos 6.* You can modify/etc/security/limits.d/90-nproc.conf by modifying/etc/security/limits.conf and adding * soft nproc 65535 * hard nproc 65535 at the end.
To view the default thread stack size in bytes, use the command:ulimit -s
/proc/sys/vm/max_map_count #Hardware Memory Size
Java virtual machine itself limit: -Xms #initial java heap size -Xmx #maximum java heap size -Xss #the stack size for each thread
3. Query the number of threads or processes of a current program # pstree -p ps -e| grep java | awk '{print $1}' | wc -l
Command substitution is used above. For command substitution, that is, the command enclosed in "will take precedence and then use its output as an argument to other commands or # pstree -p process number."| wc -l
# top -H process number| wc -l
It's called pipe. About pipe: pipe symbol."|"The output of the command on the left serves as input to the command on the right.
4. Query the number of threads or processes currently used by the entire system pstree -p| wc -l
The above is "How to limit the total number of threads in Linux system" all the content of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.