You know, in the world of Linux, everything is file. Therefore, the first step to achieve large concurrency, modify the Linux system file identifier limit number, that is, the number of file open limit
First, the total limit at the kernel level Fs.file-max
man proc has such a phrase /proc/sys/fs/file-max This file defines a system-wide limit on the number of open files for all processes. (see also setrlimit (2), which can be used by a process to set the per-process limit, RLIMIT_NOFILE, on the number of files it may open.) If you get lots of error messages about running out of file handles, try Increasing this value: echo 100000 > /proc/sys/fs/file-max
View Limit number Fs.file-max[[email protected]]# sysctl Fs.file-maxfs.file-max = 65535 Modify Limit number [email protected]]# sysctl-w Fs.file-max=6553500fs.file-max = 6553500
/PROC/SYS/FS/FILE-NR usage of FD in the recording system, number of allocated file handles
[[email protected]]# sysctl FS.FILE-NRFS.FILE-NR = 960 0 6553500
Linux File Identifier Restrictions