Simply, max-file represents the number of file handles that can be opened at the system level, and ulimit -n controls the number of file handles that can be opened at the process level.
man 5 proc, find file- Explanation of max: file-max specifies the number of file handles that can be opened by all processes in the system (system level, kernel-level). (The value in file-max s the maximum number of file handles that the Linux kernel Will allocate). When receiving an error message such as "Too many open files in system", you should have added this value.
# cat /proc/sys/fs/file-max185230# echo 100000 > /proc/sys/fs/file-max
or # echo ""fs.file-max=65535" >> /etc/sysctl.conf# sysctl -p
The kernel constant NR_OPEN imposes an upper limit on the value that may be placed in file-max. (This sentence means? Not too clear)
For the 2.2 kernel, you also need to consider inode- Max, the general inode-max is set to 4 times the file-max. For 2.4 and later kernels, there is no inode-max file.
file-nr can view the number of file handles currently open in the system. It contains 3 numbers: the first indicates the number of file descriptors that have been allocated, the second indicates the number of free file handles, and the third indicates Ability to open the maximum value of the file handle (consistent with file-max). The kernel will dynamically allocate file handles, but will not release them again (this may not fit the latest kernel, see the second in my file-nr The column is always 0, the first column has increments and subtractions.)
man bash, find the section that explains ulimit: provide available resources to the shell and the processes it starts (including file handles, number of processes, core Control of file size, etc. This is the process level, that is to say, how many file descriptors can be opened in a session and each process started in the system, how many child processes can be forked, etc. …
When the upper limit is reached, it will report an error "Too many open files" or encounter Socket/File: Can’t open so many files, etc.
Another thing to note is that each resource has a soft Hard limit, soft limit is inside The limit value imposed on the corresponding resource, the hard limit is the maximum value of the soft limit. The unauthorized call process can only specify its soft limit to a value in the range 0 to hard limit, and can irreversibly reduce its hard limit. The authorization process can arbitrarily change its hard and soft limits. The value of RLIM_INFINITY indicates no resource restrictions.
Use the -H and -S options respectively to specify settings that require hard/soft limits on the resource. Specify, hard limit and soft limit are set at the same time.
The limit value of the print resource. If you do not explicitly specify -H, the print is -S
To change the ulimit of apache, you can use /usr /sbin/apachectl Modify the value of ULIMIT_MAX_FILES in this script
The number of open file handles is too large. If the file descriptors are tcp sockets, etc, then you risk using up a large amount of Memory for the socket buffers and other kernel objects; this memory is not going to be swappable.
The other thing to remember is that socket connection is also a file.
According to statcounter statistics, the global operating system market share in March is still Win7
The disk sector defaults to 512 bytes. To verify, execute it from the command line: fdisk -l
The SELinux function is an implementation of mandatory access control, which can
According to the US technology blog TNW, the well-known Linux vendor Canonical today released and de
How to configure multiple network cards in redhat linux 6 version of bonding
How to configure chroot SFTP in Linux
Several security precautions for Linux systems
Powerful screen commands in Linux systems
Understand the basics of Fdisk under Linux
Linux vsftp configuration tutorial
Installing rpm file package under Linux
Linux administrators must not know the top ten PHP security points
Common shortcuts under the Linux command line
Linux operating system password file security problem analysis
Tiny4412 assembly water light code, Tiny4412 bare metal LED operation
Win10 Mobile 10586.36 experience in Lumia640 XL Very smooth
Solutions to common faults in Windows systems
Can win7 system directly install Directx12?
Win10 system lock screen unlocked but can not enter the desktop solution graphic tutorial
Win10 by modifying the registry to achieve the right-click jump function method
Can you use the virtual installation Win10 system to install Win10 tutorial
How does the win10 system automatically turn off the display
Coreldraw how to map? Coreldraw map tutorial
How does the Win7 system change the drive letter? Win7 modify the system drive letter tutorial