This problem occurs because system restricts the number of files opened by the program.
Use the ulimit-a command to view
We can see that the limit on the number of open files is 1024. We can increase the number of files that can be opened by modifying 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 program 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:
*-Nofile 65535
*-Nproc 65535
Note: This line sets the default number of files opened by each user to 2048. Note that "nofile" has two possible restrictions. Is hard and soft under <type>. To make the maximum number of files opened after modification take effect, you must set these two restrictions. If you use the "-" character setting <type>, the hard and soft settings are set at the same time.
Hard limit indicates the maximum value that can be set in the soft limit. The soft limit refers to the setting value that takes effect for the current system. The hard limit value can be reduced by common users. But cannot be added. Soft restrictions cannot be set more than hard restrictions. Only root users can increase the hard limit value.
When the file limit description is added, you can simply double the current value. The example is as follows. If you want to increase the default value by 1024, it is best to increase it to 2048. If you want to continue to increase it, you need to set it to 4096.
Finally, use ulimit-a to check the value of open files again. If there is no problem, it has been changed.
**************************************** **************************
-------------------------------------------------------------
After the above settings, log out of shell and log on again, but it still does not take effect.
Add a ulimit-SHn 51200 row under // etc/profile (note that there is a setting for ulimit)
Add a ulimit-SHn 51200 line under rc. local (I don't know if this line is necessary, but I haven't added it yet)
For details, see:
Ulimit-S-c 0>/dev/null 2> & 1
This statement sets the software resources and core file size.