Nginx之——nginx:accept failed 24: Too many open files
有一台服务器访问量非常高,使用的是nginx ,错误日志不停报以下错误:
2016/05/16 08:53:49 [alert] 13576#0: accept() failed (24: Too many open files)
2016/05/16 08:53:49 [alert] 13576#0: accept() failed (24: Too many open files)
2016/05/16 08:53:49 [alert] 13576#0: accept() failed (24: Too many open files)
2016/05/16 08:53:49 [alert] 13576#0: accept() failed (24: Too many open files)
2016/05/16 08:53:49 [alert] 13576#0: accept() failed (24: Too many open files)
2016/05/16 08:53:49 [alert] 13576#0: accept() failed (24: Too many open files)
2016/05/16 08:53:49 [alert] 13576#0: accept() failed (24: Too many open files)
2016/05/16 08:53:49 [alert] 13576#0: accept() failed (24: Too many open files)
2016/05/16 08:53:49 [alert] 13576#0: accept() failed (24: Too many open files)
2016/05/16 08:53:49 [alert] 13576#0: accept() failed (24: Too many open files)
解决方法:
centos5.3 中 ulimit -n 为1024, 当Nginx连接数超过1024时,error.log中就出现以下错误:
[alert] 12766#0: accept() failed (24: Too many open files)
使用 ulimit -n 655350 可以把打开文件数设置足够大, 同时修改nginx.conf , 添加 worker_rlimit_nofile 655350; (与error_log同级别)
这样就可以解决Nginx连接过多的问题,Nginx就可以支持高并发。还要修改nginx
上一篇: 总结HTML form表单的一些用法
推荐阅读
-
Nginx failed Too many open files nginxulimit
-
Nginx: 24: Too Many Open Files 错误和解决方案【转】
-
解决Nginx出现“Too many open files”的问题【转】
-
Nginx: 24: Too Many Open Files 错误和解决方案【转】
-
解决Nginx出现“Too many open files”的问题【转】
-
nginx - php failed to open stream: Too many open files in
-
nginx - php failed to open stream: Too many open files in
-
Nginx之——nginx:accept failed 24: Too many open files
-
Nginx之——nginx:accept failed 24: Too many open files