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)
Why are the SQL queries you write slow? Why do th...
1. Introduction to VMware vSphere VMware vSphere ...
K8s k8s is a cluster. There are multiple Namespac...
Today I helped a classmate solve a problem - Tomc...
I found a strange problem when deploying the proj...
Scenario: A laradock development environment (php...
This article describes the MySQL transaction mana...
nginx (engine x) is a high-performance HTTP and r...
This article example shares the specific code for...
/****************** * Advanced character device d...
This article shares with you a draggable photo wa...
1. Set and change the root password Check whether...
Table of contents Preface 1. Basic knowledge of f...
for loop The for loop loops through the elements ...
Everyone may be familiar with the select drop-dow...