How to adjust the "Maximum number of handles to open files in the operating system "?

Source: Internet
Author: User
Use the/proc file system to control the system
/Proc/sys/fs
/Proc/sys/fs/file-max
This file specifies the maximum number of file handles that can be allocated. If you get an error message stating that the number of opened files has reached the maximum value, so that they cannot open more files, you may need to increase the value. You can set this value to any number of files and change it by writing a new numeric value to the file.

Default: 4096

/Proc/sys/fs/file-NR
This file is related to file-Max. It has three values:
Number of allocated file handles
Number of file handles used
Maximum number of file handles
This file is read-only and only used to display information.

Therefore, there is no issue of simultaneous modification of two files. You can only modify file-max.

3. ulimit-
Open File (-N) 1024

That is, ulimit-n

-N the maximum number of open file descriptors (most systems
Do not allow this value to be set)

Ulimit-n <number of files that can be opened at the same time> sets the maximum number of files that can be opened at the same time (max open files)

Example: ulimit-N 8192

If this parameter is set too small, the too program open files error may occur for websites with a large number of concurrent visits.

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.