In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to do too many open files problems in linux, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
The reason for this problem is that system limits the number of files that the program can open.
You can view it with the ulimit-a command
[root@5] # ulimit-a
Core file size (blocks,-c) 0
Data seg size (kbytes,-d) unlimited
Scheduling priority (- 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
Real-time 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
As you can see, the limit for open files is 1024, and we can increase the number of files that can be opened by changing this value.
*
Temporary modification:
Change it to 2048 and use ulimit-n 2048.
When you increase the value of open files to a certain extent, your Too many open files will no longer appear.
*
To change these two parameter values for a long time, modify / ect/security/limits.conf and add two lines to the file:
The code is as follows:
*-nofile 65535
*-nproc 65535
Note: this line sets the default number of open files per user to 2048. Note that there are two possible restrictions for the "nofile" item. Are hard and soft under this item. For the maximum number of open files to take effect, these two limits must be set. If you use the "-" character setting, the hard and soft settings are set at the same time.
The hard limit indicates the maximum value that can be set in the soft limit. The soft limit refers to the setting for which the current system is in effect. The hard limit can be lowered by ordinary users. But it cannot be increased. The soft limit cannot be higher than the hard limit. Only root users can increase the hard limit.
When adding a file limit description, you can simply double the current value. As an example, if you want to increase the default value of 1024, you'd better increase it to 2048, and if you want to continue to increase it, you need to set it to 4096.
Finally, use ulimit-a to check again, the value of open files, if there is no problem, it has been changed.
*
Http://www.linuxso.com/linuxrumen/6217.html
After the above settings, log out of shell and log in again, it still won't take effect.
Under / / etc/profile, add a line ulimit-SHn 51200 (note that there is already a setting for ulimit)
Under rc.local, add the line ulimit-SHn 51200 (I don't know if this is necessary, but I haven't added it yet)
For details, see: http://baike.baidu.com/view/4832100.htm
Ulimit-S-c 0 > / dev/null 2 > & 1
This statement sets the settings for software resources and the core file size
The above is all the contents of the article "what to do if there is a too many open files problem in linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to 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.