Linux tomcat too many open files

Source: Internet
Author: User

First, the problem appearance:

Program Log error: Java.io.IOException:Too many open files at

Second, the solution:

1. Check the maximum number of files that the system is allowed to open:
Cat/proc/sys/fs/file-max
2. View the maximum number of files allowed to open per User:
Ulimit-a
3, the discovery system default is open files (-N) 1024, the problem appears here.
Modify this quantity limit in the system file /etc/security/limits.conf to include content in the file:
* Soft Nofile 65536
* Hard Nofile 65536
Another method:
1, use Ps-ef |grep Java (Java on behalf of your program, view your program process) to view your process ID, record ID number, assuming the process ID is 12
2. Using lsof-p | wc-l View the current file operation status for process ID 12
A file usage of 1052 occurs when the command is executed
3. Use the command ulimit-a to see the maximum number of files allowed to open per user
The discovery system defaults to open files (-N) 1024, which is where the problem occurs.
4. Then execute ulimit-n 4096
Set open files (-N) 1024 to open files (-N) 4096

Excerpt from: https://www.aliyun.com/jiaocheng/120721.html

Linux tomcat too many open files

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.