In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is to share with you about how to modify CentOS ulimit system commands. The editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
The adjustment of the CentOS value (number of Linux file handles) in CentOS5 (RHEL5).
When deploying applications under Linux, we sometimes encounter the problem of Socket/File: Can't open so many files, for example, there is Squid as a proxy, when the file is opened to more than 900hrs, it can drop very quickly, and the web page may not be opened.
In fact, Linux is limited by file handles, and Linux is not very high by default, usually 1024, which can be easily reached by production servers.
View method
We can use CentOS ulimit-a to see all the limit values
[root@centos5] # Centos ulimit-a
Core file size (blocks,-c) 0
Data seg size (kbytes,-d) unlimited
Max nice (- e) 0
File size (blocks,-f) unlimited
Pending signals (- I) 4096
Max locked memory (kbytes,-l) 32
Max memory size (kbytes,-m) unlimited
Open files (- n) 1024
Pipe size (512 bytes,-p) 8
POSIX message queues (bytes,-Q) 819200
Max rt priority (- r) 0
Stack size (kbytes,-s) 10240
Cpu time (seconds,-t) unlimited
Max user processes (- u) 4096
Virtual memory (kbytes,-v) unlimited
File locks (- x) unlimited | | > / etc/security/limits.conf
You can change the file handle limit to soft 32768 and hard 65536. The first part of the configuration file refers to domain, which is set to an asterisk to represent the global situation. In addition, you can also make different restrictions for different users. The hard limit in this is the actual limit, while the soft limit, which is the warnning limit, only makes warning. In fact, the CentOS ulimit command itself has soft and hard settings, adding-H means hard, and adding-S means soft default shows soft limits. if you do not add it when you run the CentOS ulimit command to modify it, the two parameters are changed together. Take effect
You can see it when you re-log in after modification. My system is CentOS5.1. If modified, it will take effect immediately after re-logging in. You can check confirmation with CentOS ulimit-a.)
If you use squid, you need to add CentOS ulimit-HSn 65535 to the / etc/init.d/squid file. In addition, max_filedesc 16384 should be added to squid.conf.
The above is how to modify the CentOS ulimit system commands. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.