[Toomanyopenfiles] is reported in the product Today. the related knowledge is as follows. View the maximum number of files allowed to be opened by the system # cat/proc/sys/fs/file-max view the maximum number of files allowed to be opened by each user ulimit-a found that the default system is openfiles (- n) 1024 ,...
[Too program open files] is reported in the product Today. the related knowledge is as follows. View the maximum number of files allowed to be opened by the system # cat/proc/sys/fs/file-max view the maximum number of files allowed to be opened by each user ulimit-a found that the default system is open files (-n) 1024, the problem occurs here. In the system file/etc/security/limits. modify the limit in conf and add the following content to the File: * soft nofile 65536 * hard nofile 65536 www.2cto.com 1. use ps-ef | grep java (java represents your program, view your program process) to view your process ID, record the ID number, and assume that the process ID is 122. run: lsof-p 12 | wc-l to view the file operation status of the current process id 12. run this command and the file usage is 10523. run the command: ulimit-a to view the maximum number of files that each user can open. the default value is open files (-n) 1024. 4. run ulimit-n 4096 to set open files (-n) 1024 to open files (-n) 4096, which increases the maximum number of files that a user can open, setting ulimit for each user connected to ssh does not affect each other. Now, the solution of our product is to add ulimit-n 65535 to the startup script sh. of course, this is only necessary. In general, we should first check the file stream closure. Author and artist
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.