一、首先修改nginx配置文件:
user root; worker_processes 4; #配置Nginx worker进程最大打开文件数 worker_rlimit_nofile 65535; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 65535; }
主要是添加
worker_rlimit_nofile 65535;
worker_connections 65535;
这两个地方。
二、Linux系统中的ulimit -n也需要相应的调大,但基本上不用改变。