ulimit -n ulimit -n 65535 /etc/sysctl.conf 修改为 fs.file-max=65535
vm.max_map_count=262144
生效
/sbin/sysctl -p
查看进程打开文件数
lsof -p pid |wc -l
查看系统打开文件数
lsof |wc -l
最大文件数
ulimit -a
vi /etc/security/limits.conf
/proc/sys/fs/file-nr
已分配文件句柄的数目
已使用文件句柄的数目
文件句柄的最大数目
修改 /etc/security/limits.d/20-nproc.conf
vi /etc/security/limits.conf
末尾追加
* soft nofile 65536
* hard nofile 65536
* soft nproc 65536
* hard nproc 65536