FastNetMon

Monday 18 January 2010

Nginx: accept() failed (24: Too many open files) while accepting new connection on

Причина:

2010/01/18 21:08:00 [alert] 20014#0: accept() failed (24: Too many open files) while accepting new connection on 0.0.0.0:80


Ранее я это делал посредством добавления ulimit -n 10000 в init скрипт, но есть более правильный способ.

Достаточно в конфиг:
vi /etc/nginx/nginx.conf


На корневой уровень (например, прямо под "worker_processes"), не в http или event блоки, добавить:
worker_rlimit_nofile 100000;

И перезапустить nginx:
/etc/init.d/nginx restart

2 comments :

  1. This comment has been removed by the author.

    ReplyDelete
  2. Спасибо тебе за твой блог. Часто выручает!:)

    ReplyDelete

Note: only a member of this blog may post a comment.