Linux News too many open files solution

Source: Internet
Author: User

Today, there is a server in the system exception, and sometimes even simple shell commands can not be executed, a variety of strange errors, and sometimes successfully executed

Such as:

-bash:error while loading shared libraries:libncurses.so.5:cannot open Shared object File:error 23

-bash:/etc/profile:too Many open files in system

View the number of open files allowed by the current operating system

Ulimit-n

The discovery is set to 163840, the execution lsof|wc-l command is 65528, and the value set is still a big gap, why also reported too many open files, suddenly remembered there is a place to set the maximum number of files

Using commands

Cat/proc/sys/fs/file-max

65536, this time know why there are occasional anomalies, the current system uses the number of files and the maximum number of close

echo 131072 >/proc/sys/fs/file-max increases directly by one-fold, which can take effect immediately, but fails if the operating system restarts

If you need to permanently take effect, Modify the/etc/sysctl.conf file, followed by Fs.file-max = 131072, the execution sysctl-p takes effect

So when there are too many open files in the system, there are 2 places to look at.

Problem solving.

Linux News too many open files solution

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.