nginx_Too many open files

來源:互聯網
上載者:User

標籤:accept() failed (24: 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 /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網路服務搭建” 部落格,謝絕轉載!

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.