[ pid=3413 thr=140583025772288 file=ext/nginx/HelperAgent.cpp:963 time=2014-09-30 11:05:20.925 ]: Uncaught exception in PassengerServer client thread: exception: Cannot accept new connection: Too many open files (24) backtrace: in 'Passenger::FileDescriptor Client::acceptConnection()' (HelperAgent.cpp:429) in 'void Client::threadMain()' (HelperAgent.cpp:952)
intexpand_files(struct files_struct *files, int nr) { structfdtable *fdt;
fdt = files_fdtable(files);
/* * N.B. For clone tasks sharing a files structure, this test * will limit the total number of files that can be opened. */ if (nr >= current->signal->rlim[RLIMIT_NOFILE].rlim_cur) return -EMFILE;
/* Do we need to expand? */ if (nr < fdt->max_fds) return0;
/* Can we expand? */ if (nr >= sysctl_nr_open) return -EMFILE;
/* All good, so we try */ return expand_fdtable(files, nr); }
可以看到expand_files进行文件描述符限制的检查,当超过限制时返回”EMFILE”。”EMFILE”错误的提示就是”Too many open files”。
structngx_http_variable_s { ngx_str_t name; /* must be first to build the hash */ ngx_http_set_variable_pt set_handler; ngx_http_get_variable_pt get_handler; uintptr_t data; ngx_uint_t flags; ngx_uint_t index; };
start(Port, Module, Opts) -> %% Check if the module is an ejabberd listener or an independent listener ModuleRaw = strip_frontend(Module), case ModuleRaw:socket_type() of independent -> ModuleRaw:start_listener(Port, Opts); _ -> start_dependent(Port, Module, Opts) end.
LDstDomain = To#jid.lserver, case mnesia:dirty_read(route, LDstDomain) of [] -> ejabberd_s2s:route(From, To, Packet); [R] -> Pid = R#route.pid, if node(Pid) == node() -> case R#route.local_hint of {apply, Module, Function} -> Module:Function(From, To, Packet); _ -> Pid ! {route, From, To, Packet} end; is_pid(Pid) -> Pid ! {route, From, To, Packet}; true -> drop end; ... end