Maximum number of opened handles for each process in Linux

Source: Internet
Author: User

How to increase file descriptors max limit on Linuxposted on February 27,200 8 in hacks, howto, linux with 7 comments Today my DBA reported that the server she was working on was spitting out "too open files" errors and no new processes cocould be started. this is a common problem with DB servers with heavy transactions. in my environment there are 6 DB instances running on t He server. no quite the optimized setup I wocould say. the fix was to increase the total file descriptors kernel parameter count in the/etc/sysctl. conf file. I doubled my limit from 8192 to 16384.The walk through, 1. find out what the current open file descriptor limit is. (here, the number of our server queries is over 1.6 million, haha )~ # More/proc/sys/fs/file-max ~ #8192 or ~ # Sysctl-a | grep fs. file-max ~ # Fs. file-max = 8192 2. View how many open file descriptors are currently being used .~ # More/proc/sys/fs/file-nr ~ #8191 3. View how many files are open. The number returned might defer as 1 file descriptor can have multiple open files attached to it .~ # Lsof | wc-l ~ #10325 4. Edit the kernel paramneter file/etc/sysctl. conf and add line "fs. file-max = [new value]" to it .~ # Vi/etc/sysctl. conf fs. file-max = 331287 5. Apply the changes .~ # Sysctl-p ~ # Fs. file-max = 331287 Problem fixed.

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.