[erlang-questions] tcp connections dropped in gen_server

Per Hedeland per@REDACTED
Thu Sep 8 13:23:27 CEST 2011


Reynaldo Baquerizo <reynaldomic@REDACTED> wrote:
>
>Achh,, found it (think so)
>I've hit the ERL_MAX_PORTS limit

>    exception error: no match of right hand side value {error,enfile}

>For further reference I am running Erlang on a Windows Server 2008.

I don't know if things are radically different on Windows (I would hope
not), but on *nix 'enfile' means

1> file:format_error(enfile).
"file table overflow"

which is a system-wide (i.e. in your OS) limit on the number of open
file descriptors, as opposed to

2> file:format_error(emfile).
"too many open files"

which is a per-OS-process limit for the same thing, i.e. in this case
for the Erlang VM, whereas hitting ERL_MAX_PORTS results in

3> file:format_error(system_limit).
"a system limit was hit, probably not enough ports"

Btw, on *nix, ERL_MAX_PORTS defaults to the closest power of 2 at or
above the limit that gives 'emfile' - but you can of course hit
ERL_MAX_PORTS without getting 'emfile' when you use ports for things
that aren't file descriptors - notably drivers.

--Per Hedeland



More information about the erlang-questions mailing list