Reputation: 735
I tried to increase file descriptors max limit on GNU/Linux:
$ ulimit -n 999999
and I'm starting the server with -env ERL_MAX_PORTS 4096
.
Whenever I'm using test util, after 1012-1024 opened connection I'm getting the messages "Closed: socket_closed_remotely" and "Closed: emfile".
Upvotes: 2
Views: 2045
Reputation: 9676
Try tweaking max
option which is passed to mochiweb_socket_server:start/1
from your APPLICATION_web:start/1
, where APPLICATION
is the name of your application; for example your application called helloworld
, then you will find the function start/1
in file ./src/helloworld_web.erl
which looks like:
start(Options) ->
{DocRoot, Options1} = get_option(docroot, Options),
Loop = fun (Req) ->
?MODULE:loop(Req, DocRoot)
end,
mochiweb_http:start([{name, ?MODULE}, {loop, Loop} | Options1]).
Modify call to mochiweb_http:start/1
to include the option max
:
mochiweb_http:start([{max, 1000000}, {name, ?MODULE}, {loop, Loop} | Options1]).
Hope that helps.
Upvotes: 1