Too many open files problem on Linux server

Source: Internet
Author: User

The previous test encountered a "too many open files" issue. Ulimit-hn found out that the maximum open file number on the server is 4096. Wrote a simple script to detect that the process created by the number of FD is increasing, 8 minutes later reached the upper limit and then the program error, most of which FD is about the socket.

Install lsof on the server to view the current process open file and locate the most frequently occurring communication host and port. The last discovery is a Java program bug, and the method that executes every two seconds continuously creates a new httpclient. Fixed a bug after the process created the number of FD stable at 24.

Lsof-i-a-p $PID can list all the network files that the process opens. The simple detection script used is

#!/bin//proc/$ (PSgrepgrep grepawk'{print $}  ')/fdwhiletruedolsgrepWC -lsleep5 Done

Too many open files problem on Linux server

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.