-
centos最大文件数,系统一般默认为1024
查看命令:ulimit -n
-
ulimit最大文件打开数的全局设置
vim /etc/security/limits.conf
在最后添加
root soft nofile 65535 root hard nofile 65535 * soft nofile 65535 * hard nofile 65535
“*”表示所有用户都生效
-
reboot 重启生效
此时再执行ulimit -n 显示65535
这个设置解决Nginx:too man open files 报错