The cause is that the process opens a number of files and communication links that exceed the system limit at a certain moment. You can use the command ulimit -a to view the maximum number of handles currently set by the system.
As you can see, the configuration of open files is 1024. You can increase the open files by running the following command
This modification method can temporarily increase the number of open files to 65535, but this configuration will become invalid after the system restarts. Another way is to modify the system configuration file. Taking Ubuntu as an example, the default configuration file is
Add this configuration file
If you want to view the number of handles currently opened by a process, you can use the following command:
In addition, if you use supervisor to host and start the project, you will encounter the problem that this configuration cannot take effect. The reason is that supervisor will configure the number of open handles to be 1024 by default. If you want to view the maximum open files of a process, you can view it through the limits corresponding to the process number of this process.
One of the lines is:
The default value of the supervisor-hosted program is 1024, which is the maximum number of supervisor configurations. At this time, you need to manually modify the supervisor configuration file. The modification method is as follows. Taking the Ubuntu system as an example, find the supervisor configuration file supervisord.conf In the [supervisord] option, add the minfds option configuration
After configuration, you need to restart supervisor (taking systemctl as an example)
It will take effect In passing:
Check the number of open files for the corresponding process
The above is the detailed content on how to solve the problem of Too many open files under Linux. For more information on solving the problem of Too many open files under Linux, please pay attention to other related articles on 123WORDPRESS.COM! You may also be interested in:
|
<<: It is not recommended to copy the content in Word directly to the editor on the website.
>>: Input file custom button beautification (demo)
Table of contents Preface 1. Introduction to Axio...
Table of contents Jenkins installation Install Ch...
MySQL download and installation (version 8.0.20) ...
If you want to install multiple tomcats, you must...
HTTP Header Explanation 1. Accept: Tells the web s...
Table of contents 1. Implicit conversion Conversi...
This is my first blog post. Due to time constrain...
This article shares the specific code for impleme...
<br />I have compiled some domestic design w...
Preface: Recently, the company project changed th...
Import: Due to project requirements, we will enca...
After configuring the tabBar in the WeChat applet...
Unicode is a character encoding scheme developed ...
Table of contents 1. Introduction to the connecti...
1. Install MySQL database on mac 1. Download MySQ...