Number of file handles that can be opened by a single process in Linux

Source: Internet
Author: User
The number of file handles that can be opened by a single process in Linux-general Linux technology-Linux programming and kernel information. For details, refer to the following section. Run ulimit-n

The default size is 1024. Of course, you can also set ulimit-n 10240 or something like

This problem left me directly suffering for two days and indirectly suffering for a week.

It has always been strange that a thread only sleep for five seconds, then writes data to a file for a while, and opens and closes it. Why does this thread die? This feature is extremely simple.

Later, I finally found out that another thread had an error. The number of file handles opened by that thread was too large, exceeding 1024. As a result, the preceding simple thread could not even open the file, no error is reported, and it keeps freezing.

I have to say that this problem is abnormal.

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.