2014/08/05 08:53:49 [alert] 13576#0: accept() failed (24: Too many open files)
方法一:只对root和nodbdy用户增加该值。
#vim /etc/security/limits.conf
root soft nofile 10240
root hard nofile 10240
nobody soft nofile 10240
nobody hard nofile 10240
方法二:对所有用户增加该值
代码如下 复制代码
* soft nofile 655360
* hard nofile 655360
编辑nginx配置文件
#vim /etc/nginx/nginx.conf
worker_rlimit_nofile 10240;
worker_connections 10240;
注意:需要重启系统
#lsof | wc -l
1465
# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 3675
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 10240
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 3675
virtual memory (kbytes, -v) unlimited
file locks (-x
本文出自 “linux网络服务搭建” 博客,谢绝转载!
nginx_Too many open files,布布扣,bubuko.com
原文:http://8824130.blog.51cto.com/8814130/1536091