Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

erlang with > 1024 max open files / sockets #6143

Closed
bharendt opened this issue Jun 23, 2011 · 8 comments
Closed

erlang with > 1024 max open files / sockets #6143

bharendt opened this issue Jun 23, 2011 · 8 comments

Comments

@bharendt
Copy link

To enable erlang on OSX to open more than 1024 files or sockets (regardless what ulimit -n says)
erlang must be compiled with -DFD_SETSIZE=10000 and -DDARWIN_UNLIMITED_SELECT.

So adding CFLAGS="-DFD_SETSIZE=10000 -DDARWIN_UNLIMITED_SELECT" to the ./configure parameters
in /usr/local/Library/Formula/erlang.rb enables erlang to open 10000 files or sockets simultaneously
(if ulimit -n is also set to at least 10000).

This is caused by https://github.com/erlang/otp/blob/dev/erts/emulator/sys/common/erl_poll.c line 2186
becuase max_fds is set to FD_SETSIZE, and it is limited to 1024 for OSX.

See:
http://erlang.2086793.n4.nabble.com/clipping-of-max-of-file-descriptors-by-erts-when-kernel-poll-is-enabled-td2108706.html

It is quite nasty testing or running an erlang server that accepts tcp connection when it is limited to 1024
connections. when erlang was compiled with that two flags it worked fine for me.

@mlen
Copy link
Contributor

mlen commented Oct 9, 2011

Hi,

I've updated erlang formula. Can you put a file from this gist to $(brew --prefix)/Library/Formula/erlang.rb and check whether it has fixed the issue? The 1024 connections limit isn't disabled by default and you should install erlang by passing --no-connection-limit option to homebrew to disable this limit.

Cheers!

@adamv
Copy link
Contributor

adamv commented Dec 21, 2011

Is this still an issue with 15B?

@dch
Copy link
Contributor

dch commented Jan 13, 2012

yes.

@adamv
Copy link
Contributor

adamv commented Feb 5, 2012

Has anyone reported this issue upstream to Erlang itself?

@adamv
Copy link
Contributor

adamv commented Mar 15, 2012

FWIW I don't see MacPorts doing anything here?

@DBA
Copy link

DBA commented Apr 23, 2012

Can't seem to install 15B1 either

@adamv
Copy link
Contributor

adamv commented Apr 29, 2012

Would review a new pull-request for this issue, but we will want a link to an upstream bug report containing the patch. While I agree that limiting the file descriptors is a problem, we don't like carrying unsourced patches if at all possible.

@adamv adamv closed this as completed Apr 29, 2012
@dch
Copy link
Contributor

dch commented Sep 9, 2013

FWIW this has been addressed in R16B01 anyway now -- search for erlang FD_SETSIZE if you want details.

@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants