-
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 報錯