[erlang-questions] Increase the handle limit

Tim Watson <>
Fri Oct 21 21:48:05 CEST 2011


Is the gist of this is that select() has a size limit (1024) which has
nothing to do with the OS limit on how many file handles you can open at a
time? I think Erlang still uses select on a number of platforms and
IIRC kqueue on OS-X is somehow broken so Erlang is still using select() on
the mac.

Does this really mean you can only open that many files though? I thought
this limit was something else altogether.

On 21 October 2011 17:39, Dave Cottlehuber <> wrote:

>
> On 21 October 2011 16:49, Peer Stritzinger <> wrote:
> [snip]
>
> > Little program used to find limit and reason:
> >
> > -module(test_fds).
> > -compile([export_all]).
> >
> > count() ->
> >    count(1, []).
> >
> > count(N, Fds) ->
> >    case file:open(integer_to_list(N), [write]) of
> >        {ok, F} ->
> >            count(N+1, [F| Fds]);
> >        {error, Err} ->
> >            [ file:close(F) || F <- Fds ],
> >            {Err, N}
> >    end.
>
>
> On my built-from-source :
> Erlang R14B03 (erts-5.8.4) [source] [smp:2:2] [rq:2] [async-threads:0]
>
> Eshell V5.8.4  (abort with ^G)
> 1> pwd().
> C:/erlang/scripts
> ok
> 2> c(limit).
> {ok,limit}
> 3> limit:count().
> {system_limit,1021}
>
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111021/4a099f53/attachment.html>


More information about the erlang-questions mailing list