多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
>问题:too many open files。解决方案:增加 nginx 打开 worker 进程最大文件数! # 解决参考链接: https://blog.csdn.net/roy_70/article/details/78423880 https://www.oschina.net/translate/nginx-setup?print(有用) >知识:worker_rlimit_nofile 更改worker进程的最大打开文件数限制。如果没设置的话,这个值为操作系统的限制。设置后你的操作系统和Nginx可以处理比“ulimit -a”更多的文件,所以把这个值设高,这样nginx就不会有“too many open files”问题了。 # 解决方案 ``` vim /etc/nginx/nginx.conf ``` ![mark](http://qiniu.newthink.cc/blog/20181227/79bzL9jNtIpN.jpg)\ 完整文件如下: ``` user nginx; worker_processes 1; worker_rlimit_nofile 65535; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 10240; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; keepalive_timeout 65; client_max_body_size 100m; #gzip on; include /etc/nginx/conf.d/*.conf; } ```