Too program open files

Source: Internet
Author: User

At noon, my linode server encountered an old problem and all websites were inaccessible. The Error Log (error. Log) output is full of the entire partition because nginx on the server keeps making errors. After deleting the Error Log File and restarting nginx, the system will be able to recover to normal.
I checked the error log and found that all the logs are "too temporary open files while accepting new connection on 0.0.0.0: 80 ". I searched for too program open files and found a solution.
First, check the maximum number of files that can be opened in the file system:
Root @ li55-4 :~ # Cat/proc/sys/fs/file-max
70133
So I modified it with ulimit:
Root @ li55-4 :~ # Ulimit-N 10240
This will increase the maximum number of opened files from 1024 to 10240. It should be enough.
Finally, add the "ulimit-N 10240" line to/etc/rc. Local to ensure that each system startup takes effect.
Whether this is effective remains to be observed in the future.
After actual tests, adding this line to RC. Local does not work. Using ulimit-N 10240 for modification only affects the current shell. For more information, see here. After modification, You need to restart it once before it takes effect.
Thank you for discovering the problem.

 

In the case of the ''too too open files (too many open files) "error, how can I increase the number of files allowed to be opened at the same time?

There are usually at least two resources that limit the number of files opened at the same time: the number of low-level ''file specifiers" or ''file handles" available in the operating system; and the number of file structures available in the standard stdio function library. The two conditions must be met. Under the MS-DOS, you can control the number of handle system files by setting config. sys. Some compilers include commands that increase the number of stdio file structures (maybe one or two source files)

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.