天天看點

nginx_Too many open files

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  /usr/local/nginx/conf/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

繼續閱讀